From c00c10ec11d70780e2340b6bc19f7e6cda7f0497 Mon Sep 17 00:00:00 2001 From: CHaBou Date: Fri, 3 Nov 2017 22:06:48 +0100 Subject: [PATCH] Fix Preferences menu item --- app/menus/menu.js | 2 +- app/menus/menus/darwin.js | 7 +++++-- app/menus/menus/edit.js | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/menus/menu.js b/app/menus/menu.js index 61ca2323..e6959270 100644 --- a/app/menus/menu.js +++ b/app/menus/menu.js @@ -48,7 +48,7 @@ exports.createMenu = (createWindow, getLoadedPluginVersions) => { }); }; const menu = [ - ...(process.platform === 'darwin' ? [darwinMenu(commandKeys, showAbout)] : []), + ...(process.platform === 'darwin' ? [darwinMenu(commandKeys, execCommand, showAbout)] : []), shellMenu(commandKeys, execCommand), editMenu(commandKeys, execCommand), viewMenu(commandKeys, execCommand), diff --git a/app/menus/menus/darwin.js b/app/menus/menus/darwin.js index c2694553..5badbd8a 100644 --- a/app/menus/menus/darwin.js +++ b/app/menus/menus/darwin.js @@ -2,7 +2,7 @@ // The label is set to appName here so it matches actual behavior const {app} = require('electron'); -module.exports = (commandKeys, showAbout) => { +module.exports = (commandKeys, execCommand, showAbout) => { return { label: `${app.getName()}`, submenu: [ @@ -17,7 +17,10 @@ module.exports = (commandKeys, showAbout) => { }, { label: 'Preferences...', - accelerator: commandKeys['window:preferences'] + accelerator: commandKeys['window:preferences'], + click() { + execCommand('window:preferences'); + } }, { type: 'separator' diff --git a/app/menus/menus/edit.js b/app/menus/menus/edit.js index c20e9380..b55f672a 100644 --- a/app/menus/menus/edit.js +++ b/app/menus/menus/edit.js @@ -45,7 +45,10 @@ module.exports = (commandKeys, execCommand) => { {type: 'separator'}, { label: 'Preferences...', - accelerator: commandKeys['window:preferences'] + accelerator: commandKeys['window:preferences'], + click() { + execCommand('window:preferences'); + } } ); }