Skip to content

Commit

Permalink
added support for quit hotkey on macOS (#995)
Browse files Browse the repository at this point in the history
* add keybinding for CMD + Q for macOS

* only add quit menu entry for macOS

* code cleanup
  • Loading branch information
ronny1982 authored Jan 26, 2020
1 parent e7d2402 commit 2ed7318
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/ElectronBootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = class ElectronBootstrap {
{
role: 'toggleDevTools',
accelerator: 'F12'
},
}
]
},
{
Expand All @@ -154,6 +154,12 @@ module.exports = class ElectronBootstrap {
]
}
];

if(process.platform === 'darwin') {
menu[0].submenu.push({ type: 'separator' });
menu[0].submenu.push({ role: 'quit' });
}

electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate(menu));
}

Expand Down

0 comments on commit 2ed7318

Please sign in to comment.