-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmenuBar.js
More file actions
86 lines (84 loc) · 2.21 KB
/
Copy pathmenuBar.js
File metadata and controls
86 lines (84 loc) · 2.21 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
let main = require('./main.js');
const { remote, BrowserWindow, shell } = require('electron');
const menuTemplate = [
{
label: 'File',
submenu: [
{
label: 'Add new word',
click() {
BrowserWindow.getFocusedWindow().webContents.send('addWord');
},
accelerator: 'CmdOrCtrl+N'
},
process.platform == 'win32'
? {
label: 'Quit dotDictionary',
role: 'quit'
}
: {
visible: false
}
]
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'CmdOrCtrl+Z',
click() {
main.history.undo();
BrowserWindow.getFocusedWindow().webContents.send('reload');
}
},
{
label: 'Redo',
accelerator: process.platform === 'darwin' ? 'Command+Shift+Z' : 'Ctrl+Y',
click() {
main.history.redo();
BrowserWindow.getFocusedWindow().webContents.send('reload');
}
},
{
role: 'reload'
},
{
label: 'Toggle Developer Tools',
accelerator: 'CmdOrCtrl+Shift+I',
click(item, focusedWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools();
}
},
{
role: 'copy'
},
{
role: 'paste'
}
]
},
{
role: 'window',
submenu: [
{
role: 'minimize'
},
{
role: 'togglefullscreen'
}
]
},
{
role: 'help',
submenu: [
{
label: 'Learn More',
click() {
shell.openExternal('https://github.com/khaled-hamam/dotDictionary');
}
}
]
}
];
module.exports = menuTemplate;