From d018fa63ffa3817a32d5f4f64afa76307b124faa Mon Sep 17 00:00:00 2001 From: lilia <liliakai@gmail.com> Date: Thu, 27 Apr 2017 11:47:08 -0700 Subject: [PATCH] Add Show option under the Window menu Window > Show will reveal the mainWindow after it has been closed. // FREEBIE --- main.js | 10 +++++++--- menu.js | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 15a0f8269..4bcb4aa54 100644 --- a/main.js +++ b/main.js @@ -157,11 +157,15 @@ app.on('ready', function() { setInterval(function() { autoUpdater.checkForUpdates(); }, autoUpdaterInterval); } + createWindow(); + let template = require('./menu.js'); - const menu = Menu.buildFromTemplate(template) - Menu.setApplicationMenu(menu) + template[3].submenu[3].click = function() { + mainWindow.show(); + }; + const menu = Menu.buildFromTemplate(template); + Menu.setApplicationMenu(menu); - createWindow(); }) app.on('before-quit', function() { diff --git a/menu.js b/menu.js index cefd0a8d0..f12ab2510 100644 --- a/menu.js +++ b/menu.js @@ -137,6 +137,9 @@ if (process.platform === 'darwin') { label: 'Zoom', role: 'zoom' }, + { + label: 'Show', + }, { type: 'separator' },