Fix Preferences menu item

This commit is contained in:
CHaBou 2017-11-03 22:06:48 +01:00
parent ec6ecdd258
commit c00c10ec11
No known key found for this signature in database
GPG key ID: EF8D073B729A0B33
3 changed files with 10 additions and 4 deletions

View file

@ -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),

View file

@ -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'

View file

@ -45,7 +45,10 @@ module.exports = (commandKeys, execCommand) => {
{type: 'separator'},
{
label: 'Preferences...',
accelerator: commandKeys['window:preferences']
accelerator: commandKeys['window:preferences'],
click() {
execCommand('window:preferences');
}
}
);
}