-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenus.js
36 lines (35 loc) · 1.36 KB
/
menus.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
const {app,shell,dialog,Notification}=require('electron')
module.exports=[
{
label:"File",
submenu:[
{label: "Reload",role:"reload"},
{label: "Exit",click: ()=>{app.quit()},accelerator:"Alt+F4"},
]
},
{
label:"Actions",
submenu:[
{label: "Development Mode",role:'toggleDevTools'},
{label:"Full Screen",role:"toggleFullScreen"},
// {label:"menu2",enabled:false},
// {
// label:"menu3",
// click: ()=>{console.log("hello")},
// accelerator:'Shift+Alt+G'
// },
]
},
{
label:"Help",
submenu:[
{label:"Shortcuts",click:()=>{const dialogOptions = {type: 'info', buttons: ['OK'], message: 'New Note: Ctrl+N\nModify Note: Ctrl+Shift+N\nDelete Note: Ctrl+D'}
dialog.showMessageBox(dialogOptions)}},
{label:"Visit Repository",click:()=>{shell.openExternal("https://github.com/abhi211199/NotesApp")}},
{label:"About",click:()=>{
const dialogOptions = {type: 'info', buttons: ['OK'], message: 'Developed by Abhishek Garain!'}
dialog.showMessageBox(dialogOptions)}},
{label:"Loved it!",click:()=>{let notif=new Notification({title:"NotesApp",body:("Star the repository!")});notif.on('click',()=>{shell.openExternal("https://github.com/abhi211199/NotesApp")});notif.show()}}
]
}
]