Fix app not hiding and add quit option

This commit is contained in:
zweicoder 2016-01-30 10:48:48 +08:00
parent e184aa13ae
commit 0c9d6312a4
1 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,7 @@ app.on('window-all-closed', () => {
// determined opts
if(appArgs.minimizeToTray){
mainWindow.hide();
return;
}
if (!isOSX()) {
app.quit();
@ -79,6 +80,13 @@ app.on('ready', () => {
appArgs.minimizeToTray = menuItem.checked = !menuItem.checked;
fs.writeFileSync(APP_ARGS_FILE_PATH, JSON.stringify(appArgs));
}
},
{
label: 'Close',
type: 'normal',
click: function (menuItem) {
app.quit();
}
}
]);
appIcon.setContextMenu(menu);