Splitup darwin menu from others to make it more clear what's going on
This commit is contained in:
@@ -9,6 +9,25 @@ var createTemplate = function(mainWindow) {
|
||||
var template = [];
|
||||
|
||||
const platformAppMenu = process.platform === 'darwin' ? [{
|
||||
label: 'About ' + app_name,
|
||||
role: 'about',
|
||||
click: function(item, focusedWindow) {
|
||||
electron.dialog.showMessageBox(mainWindow, {
|
||||
buttons: ["OK"],
|
||||
message: `${app_name} Desktop ${electron.app.getVersion()}`
|
||||
});
|
||||
}
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: 'Preferences...',
|
||||
accelerator: 'CmdOrCtrl+,',
|
||||
click: function(item, focusedWindow) {
|
||||
mainWindow.loadURL('file://' + __dirname + '/browser/settings.html');
|
||||
}
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: 'Hide ' + app_name,
|
||||
accelerator: 'Command+H',
|
||||
selector: 'hide:'
|
||||
@@ -21,25 +40,33 @@ var createTemplate = function(mainWindow) {
|
||||
selector: 'unhideAllApplications:'
|
||||
}, {
|
||||
type: 'separator'
|
||||
}] : [];
|
||||
}, {
|
||||
label: 'Quit ' + app_name,
|
||||
accelerator: 'CmdOrCtrl+Q',
|
||||
click: function(item, focusedWindow) {
|
||||
electron.app.quit();
|
||||
}
|
||||
}] : [{
|
||||
label: 'Settings',
|
||||
accelerator: 'CmdOrCtrl+,',
|
||||
click: function(item, focusedWindow) {
|
||||
mainWindow.loadURL('file://' + __dirname + '/browser/settings.html');
|
||||
}
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: 'Quit',
|
||||
accelerator: 'CmdOrCtrl+Q',
|
||||
click: function(item, focusedWindow) {
|
||||
electron.app.quit();
|
||||
}
|
||||
}];
|
||||
|
||||
template.push({
|
||||
label: '&' + first_menu_name,
|
||||
submenu: [{
|
||||
label: (process.platform === 'darwin') ? 'Preferences...' : 'Settings',
|
||||
accelerator: 'CmdOrCtrl+,',
|
||||
click: function(item, focusedWindow) {
|
||||
mainWindow.loadURL('file://' + __dirname + '/browser/settings.html');
|
||||
}
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, ...platformAppMenu, {
|
||||
label: 'Quit',
|
||||
accelerator: 'CmdOrCtrl+Q',
|
||||
click: function(item, focusedWindow) {
|
||||
electron.app.quit();
|
||||
}
|
||||
}]
|
||||
submenu: [
|
||||
...platformAppMenu
|
||||
]
|
||||
});
|
||||
template.push({
|
||||
label: '&Edit',
|
||||
|
Reference in New Issue
Block a user