Skip to content

Instantly share code, notes, and snippets.

@rockiger
Created August 9, 2019 09:16
Show Gist options
  • Save rockiger/467e0f940c33106907980b4253a4222f to your computer and use it in GitHub Desktop.
Save rockiger/467e0f940c33106907980b4253a4222f to your computer and use it in GitHub Desktop.
...
{
label: 'Help', role: 'help',
submenu: [ submenu: [
{ {
label: 'About', label: 'About',
...
if (process.platform === 'darwin') {
const name = app.getName();
menu.unshift({
label: name,
submenu: [
{
role: 'about',
},
{
type: 'separator',
},
{
role: 'services',
submenu: [],
},
{
type: 'separator',
},
{
role: 'hide',
},
{
role: 'hideothers',
},
{
role: 'unhide',
},
{
type: 'separator',
},
{
role: 'quit',
},
],
});
menu.splice(2, 0, {
role: 'window',
submenu: [
{
label: 'Close',
accelerator: 'CmdOrCtrl+W',
role: 'close'
},
{
label: 'Minimize',
accelerator: 'CmdOrCtrl+M',
role: 'minimize'
},
{
label: 'Zoom',
role: 'zoom'
},
{
type: 'separator'
},
{
label: 'Bring All to Front',
role: 'front'
}
]
})
}
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
};
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment