Add debug item to the help menu

This commit is contained in:
Nick Denry 2020-06-17 00:22:45 +03:00
parent 9a8d03a30e
commit e2fe4fe5b3
1 changed files with 12 additions and 2 deletions

View File

@ -109,10 +109,20 @@ menuService.createMenu = () => {
const help = {
label: 'Help',
submenu: [about]
submenu: [
... !isMac ? [help] : [],
{
label: 'Debug info',
accelerator: 'F12',
click: () => {
let activeWindow = BrowserWindow.getAllWindows()[0]
activeWindow.webContents.openDevTools()
}
}
]
}
const template = [application, edit, ... !isMac ? [help] : []]
const template = [application, edit, help]
Menu.setApplicationMenu(Menu.buildFromTemplate(template))
}