mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-27 09:36:28 +08:00
update(tray): Show 'Open Inbox' tray menu option and option to disable
tray on Mac and Linux - Resolves #673 - Resolves #762 - Resolves #594
This commit is contained in:
parent
57651300ac
commit
de1f8d24d0
3 changed files with 7 additions and 6 deletions
|
@ -11,6 +11,7 @@ class SystemTray {
|
|||
this._tray = new Tray(this._store.icon());
|
||||
this._tray.setToolTip(this._store.tooltip());
|
||||
|
||||
// Check in case there is no menu for the current platform
|
||||
const menu = this._store.menu();
|
||||
if (menu != null) this._tray.setContextMenu(menu);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ const {canvasWithSystemTrayIconAndText} = CanvasUtils;
|
|||
const BASE_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas.png');
|
||||
const UNREAD_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas-unread.png');
|
||||
|
||||
const menuTemplate = [
|
||||
const _menuTemplate = [
|
||||
{
|
||||
label: 'New Message',
|
||||
click: ()=> ipcRenderer.send('command', 'application:new-message'),
|
||||
|
@ -29,15 +29,15 @@ const menuTemplate = [
|
|||
},
|
||||
];
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
menuTemplate.unshift({
|
||||
if (process.platform !== 'win32') {
|
||||
_menuTemplate.unshift({
|
||||
label: 'Open Inbox',
|
||||
click: ()=> ipcRenderer.send('command', 'application:show-main-window'),
|
||||
});
|
||||
}
|
||||
|
||||
const _buildMenu = ()=> {
|
||||
return Menu.buildFromTemplate(menuTemplate);
|
||||
return Menu.buildFromTemplate(_menuTemplate);
|
||||
};
|
||||
|
||||
class TrayStore extends NylasStore {
|
||||
|
|
|
@ -12,8 +12,8 @@ module.exports =
|
|||
systemTray:
|
||||
type: 'boolean'
|
||||
default: true
|
||||
title: "Show icon in Mac OS X menu bar"
|
||||
platforms: ['darwin']
|
||||
title: "Show icon in menu bar"
|
||||
platforms: ['darwin', 'linux']
|
||||
showImportant:
|
||||
type: 'boolean'
|
||||
default: true
|
||||
|
|
Loading…
Reference in a new issue