-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmenu.js
More file actions
89 lines (85 loc) · 2.09 KB
/
Copy pathmenu.js
File metadata and controls
89 lines (85 loc) · 2.09 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
'use strict';
const electron = require('electron');
const app = electron;
const shell = electron.shell;
// when we start there is no appName yet, hardcode it for now
const appName = 'snapcraft.io';
const Template = [
{
label: appName,
role: 'window',
submenu: [
{
label: `Quit`,
accelerator: 'CmdorCtrl+Q',
role: 'close'
}
]
},
{
label: 'Edit',
submenu: [
{
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
role: 'cut'
},
{
label: 'Copy',
accelerator: 'CmdOrCtrl+C',
role: 'copy'
},
{
label: 'Paste',
accelerator: 'CmdOrCtrl+V',
role: 'paste'
},
{
label: 'Select All',
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
}
]
},
{
label: 'Go',
submenu: [
{
label: 'Back',
accelerator: 'Alt+Left',
click() {
app.BrowserWindow.getFocusedWindow().webContents.goBack();
}
},
{
label: 'Forward',
accelerator: 'Alt+Right',
click() {
app.BrowserWindow.getFocusedWindow().webContents.goForward();
}
},
{
type: 'separator'
},
{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
role: 'reload'
}
]
},
{
label: 'Help',
role: 'help',
submenu: [
{
label: `https://snapcraft.io`,
accelerator: 'CmdOrCtrl+H',
click() {
shell.openExternal('https://snapcraft.io');
}
}
]
}
];
module.exports = electron.Menu.buildFromTemplate(Template);