From 40b6e36ddb43f9fccc86602780fead26e4d83fe3 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Tue, 17 May 2016 23:40:36 +0900 Subject: [PATCH] Add Ctrl+W shortcut to close/hide window Close #52 --- src/main/menus/app.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/menus/app.js b/src/main/menus/app.js index b4fd0e58..bc094416 100644 --- a/src/main/menus/app.js +++ b/src/main/menus/app.js @@ -135,6 +135,18 @@ var createTemplate = function(mainWindow) { } }, ] }); + template.push({ + label: '&Window', + submenu: [{ + label: 'Close', + accelerator: 'CmdOrCtrl+W', + click: function(item, focusedWindow) { + if (focusedWindow) { + focusedWindow.close(); + } + } + }] + }); return template; };