From 47a2693b15c6efaeed46a3e522cf6183dfbc0e68 Mon Sep 17 00:00:00 2001 From: Owen McCormick Date: Sat, 19 Sep 2020 17:37:48 -0700 Subject: [PATCH 1/4] Added 'Quit' option under 'File' (#741) --- src/menu.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/menu.js b/src/menu.js index 5129159da..b70165847 100644 --- a/src/menu.js +++ b/src/menu.js @@ -105,6 +105,12 @@ exports.get = function(props = {}) { label: i18n.t('menu.file', '&Preferences…'), accelerator: 'CmdOrCtrl+,', click: () => sabaki.openDrawer('preferences') + }, + {type: 'separator'}, + { + label: i18n.t('menu.file', '&Quit'), + accelerator: 'Alt+F4', + click: () => app.quit() } ] }, From 851a9bef34b221d3500e570d1a139e9f0ee27bd4 Mon Sep 17 00:00:00 2001 From: Owen McCormick Date: Mon, 21 Sep 2020 12:00:22 -0700 Subject: [PATCH 2/4] Edited accelerator --- src/menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu.js b/src/menu.js index b70165847..0cbe6618b 100644 --- a/src/menu.js +++ b/src/menu.js @@ -109,7 +109,7 @@ exports.get = function(props = {}) { {type: 'separator'}, { label: i18n.t('menu.file', '&Quit'), - accelerator: 'Alt+F4', + accelerator: 'CmdOrCtrl+Q', click: () => app.quit() } ] From 80ff937b20b03c750f39bfe8b0a77b6ff977e420 Mon Sep 17 00:00:00 2001 From: Owen McCormick Date: Mon, 21 Sep 2020 15:24:34 -0700 Subject: [PATCH 3/4] Hid 'Quit' option on MacOS --- src/menu.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menu.js b/src/menu.js index 0cbe6618b..582cd39d4 100644 --- a/src/menu.js +++ b/src/menu.js @@ -869,14 +869,16 @@ exports.get = function(props = {}) { appMenu.push(...items.slice(0, 2)) - // Remove original 'Preferences' menu item + // Remove original 'Preferences' and 'Quit' menu items let fileMenu = findMenuItem('file') let preferenceItem = fileMenu.submenu.splice( - fileMenu.submenu.length - 2, + fileMenu.submenu.length - 4, 2 )[1] + fileMenu.submenu.splice(fileMenu.length - 2, 2)[1] + appMenu.push( {type: 'separator'}, preferenceItem, From 006cf357f8f640b5d5bc7f7803b55f85996fddef Mon Sep 17 00:00:00 2001 From: Owen McCormick Date: Tue, 22 Sep 2020 07:38:35 -0700 Subject: [PATCH 4/4] Clarified MacOS menu item removal code --- src/menu.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/menu.js b/src/menu.js index 582cd39d4..99922236c 100644 --- a/src/menu.js +++ b/src/menu.js @@ -874,11 +874,9 @@ exports.get = function(props = {}) { let fileMenu = findMenuItem('file') let preferenceItem = fileMenu.submenu.splice( fileMenu.submenu.length - 4, - 2 + 4 )[1] - fileMenu.submenu.splice(fileMenu.length - 2, 2)[1] - appMenu.push( {type: 'separator'}, preferenceItem,