const template = [
{
label: 'File',
submenu: [
{
label: 'Restart',
click () {
mainWindow.webContents.send('action', {
action: 'restart'
});
}
},
{role: 'minimize'},
{role: 'close'}
]
},
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'pasteandmatchstyle'},
{role: 'delete'},
{role: 'selectall'}
]
},
{
label: 'View',
submenu: [
{role: 'reload'},
{role: 'forcereload'},
{role: 'toggledevtools'},
{type: 'separator'},
{role: 'resetzoom'},
{role: 'zoomin'},
{role: 'zoomout'},
{type: 'separator'},
{role: 'togglefullscreen'}
]
},
{
role: 'help',
submenu: [
{
label: 'Info',
click () { require('electron').shell.openExternal('https://github.com/patrikx3/onenote') }
}
]
}
]
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
mainWindow = new BrowserWindow({
icon: `${__dirname}/images/icon.png`,
toolbar: false,
});
mainWindow.loadURL('file://' + __dirname + '/index.html');