-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.js
46 lines (42 loc) · 978 Bytes
/
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
const { app, Menu, dialog } = require('electron');
function createMenu(mainWindow) {
const isMac = process.platform === 'darwin';
const template = [
// File menu
{
label: 'File',
submenu: [
{
label: 'Exit',
accelerator: isMac ? 'CmdOrCtrl+Q' : 'Alt+F4',
click() {
app.quit();
},
},
],
},
// View menu
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forcereload' },
{ role: 'togglefullscreen' },
],
},
// Help menu
{
label: 'About',
click() {
dialog.showMessageBox(mainWindow, {
title: 'About',
message: 'Unofficial Desktop for Misskey.ID\n\nMade with love by https://github.com/troke12',
buttons: ['OK'],
});
},
},
];
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}
module.exports = createMenu;