-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenu.js
31 lines (28 loc) · 930 Bytes
/
MainMenu.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
const electron = require('electron');
const Menu = electron.Menu;
class MainMenu {
static addTo (app) {
// Create the Application's main menu
const template = [
{
label: "Application",
submenu: [
{ label: "Quit", accelerator: "Command+Q", click: () => app.quit() }
]
}, {
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ type: "separator" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]
}
];
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
}
}
module.exports = MainMenu;