forked from matthinc/HomeAssistantElectron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.js
33 lines (32 loc) · 1.2 KB
/
menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = function (browserWindow, darwin, load, setPage) {
var menu = [{
label: 'Go',
submenu: [
{ label: 'States', accelerator: 'Cmd+1', click: () => setPage('states') },
{ label: 'History', accelerator: 'Cmd+2', click: () => setPage('history') },
{ label: 'Map', accelerator: 'Cmd+3', click: () => setPage('map') },
{ label: 'Configuration', accelerator: 'Cmd+4', click: () => setPage('config') },
{ label: 'Services', accelerator: 'Cmd+5', click: () => setPage('dev-service') },
{ type: 'separator' },
{ label: 'Preferences...', click: () => load('settings.html') }
]
}, {
label: 'Edit',
submenu: [{ role: 'copy' }, { role: 'selectall' }, { role: 'paste' }]
}, {
label: 'Developer',
submenu: [
{ role: 'toggledevtools' },
{ label: 'Reload', accelerator: 'Cmd+Shift+R', click: () => browserWindow.webContents.send('reload', {}) }]
}]
// Mac default menu
if (darwin) {
menu.unshift({
label: 'Home Assistant',
submenu: [
{ role: 'about' },
{ role: 'quit' }]
})
}
return menu
}