-
Notifications
You must be signed in to change notification settings - Fork 7
/
menu.js
63 lines (60 loc) · 1.77 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// menu.js
const { app, session, Menu, dialog } = require('electron/main')
const {getHA, setHA} = require('./settings')
const template = [
{
role: 'fileMenu'
},
{
role: 'viewMenu'
},
{
label: 'Extras',
submenu: [
{
label: 'Hardware Acceleration',
accelerator: 'CommandOrControl+Shift+H',
type: 'checkbox',
checked: getHA(),
click({ checked }) {
setHA(checked)
dialog.showMessageBox(
null,
{
type: 'info',
title: 'info',
message: 'Exiting Applicatiom, as Hardware Acceleration setting has been changed...'
})
.then(result => {
if (result.response === 0) {
app.relaunch();
app.exit()
}
}
)
}
},
{
label: 'Clear Cache',
click: () => {
session.defaultSession.clearStorageData()
app.relaunch();
app.exit();
}
}
]
},
{
label: 'About',
submenu: [
{
label: 'Github Project',
click: async () => {
const { shell } = require('electron')
await shell.openExternal('https://github.com/mikepruett3/chrome-remote-desktop')
}
}
]
}
]
module.exports = Menu.buildFromTemplate(template)