Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Optional tray
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Sep 10, 2019
1 parent 0eeaa1b commit 6351dec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/index.js
Expand Up @@ -108,10 +108,11 @@ function createWindow () {
})

win.on('close', (e) => {
let minimizeToTray = Store.instance().get("minimizeToTray");
if (willQuitApp) {
/* the user tried to quit the app */
win = null;
} else {
} else if(darwin || minimizeToTray) {
/* the user only tried to close the window */
e.preventDefault();

Expand Down
14 changes: 14 additions & 0 deletions app/javascripts/main/menuManager.js
Expand Up @@ -17,6 +17,7 @@ class MenuManager {
let updateData = updateManager.getMetadata();
let useSystemMenuBar = Store.instance().get("useSystemMenuBar");
let isMenuBarVisible = Store.instance().get("isMenuBarVisible");
let minimizeToTray = Store.instance().get("minimizeToTray");

window.setMenuBarVisibility(isMenuBarVisible);

Expand Down Expand Up @@ -112,6 +113,19 @@ class MenuManager {
},
{
role: 'close'
},
{
type: 'separator'
},
{
visible: process.platform !== 'darwin',
label: `Minimize to tray on close`,
type: 'checkbox',
checked: minimizeToTray,
click: () => {
Store.instance().set("minimizeToTray", !minimizeToTray);
this.reload();
}
}
]
},
Expand Down

0 comments on commit 6351dec

Please sign in to comment.