diff --git a/electron/js/menu/system.js b/electron/js/menu/system.js index 498be064f25..42b553b99d7 100644 --- a/electron/js/menu/system.js +++ b/electron/js/menu/system.js @@ -226,6 +226,14 @@ var toggleFullScreenTemplate = { }, }; +var toggleStartInTrayTemplate = { + i18n: 'menuStartInTray', + type: 'checkbox', + checked: init.restore('startInTray', false), + click: function() { + init.save('startInTray', !init.restore('startInTray')); + }, +}; var editTemplate = { i18n: 'menuEdit', @@ -438,7 +446,8 @@ module.exports = { }); windowTemplate.submenu.push( separatorTemplate, - toggleFullScreenTemplate + toggleFullScreenTemplate, + toggleStartInTrayTemplate ); toggleFullScreenTemplate.checked = init.restore('fullscreen', false); } diff --git a/electron/locale/strings-en.js b/electron/locale/strings-en.js index 01cec3b20be..2c38e410eb7 100644 --- a/electron/locale/strings-en.js +++ b/electron/locale/strings-en.js @@ -51,6 +51,7 @@ string.menuQuit = 'Quit Wire'; string.menuShowHide = 'Show/Hide Menu'; string.menuSavePictureAs = 'Save Picture As...'; string.menuNoSuggestions = 'No Suggestions'; +string.menuStartInTray = 'Start App in Tray'; string.restartNeeded = 'Restart Needed'; string.restartLocale = 'Please restart the app for this setting to take effect.'; diff --git a/electron/locale/strings.js b/electron/locale/strings.js index 053dbb69722..012f27371ee 100644 --- a/electron/locale/strings.js +++ b/electron/locale/strings.js @@ -49,6 +49,7 @@ string.menuQuit = 'Quit Wire'; string.menuShowHide = 'Show/Hide Menu'; string.menuSavePictureAs = 'Save Picture As...'; string.menuNoSuggestions = 'No Suggestions'; +string.menuStartInTray = 'Start App in Tray'; string.restartNeeded = 'Restart Needed'; string.restartLocale = 'Please restart the app for this setting to take effect.'; diff --git a/electron/main.js b/electron/main.js index 218076592e6..9c9aff93473 100644 --- a/electron/main.js +++ b/electron/main.js @@ -156,7 +156,7 @@ function showMainWindow() { main.webContents.openDevTools(); } - if (!argv.startup) { + if (!argv.startup && !init.restore('startInTray')) { if (!util.isInView(main)) { main.center(); }