Skip to content

Commit

Permalink
Always show Developer Tools in the menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
oldj committed May 29, 2021
1 parent a495f0e commit da1e639
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 45 deletions.
71 changes: 27 additions & 44 deletions src/main/ui/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,25 @@ export const makeMainMenu = (locale: LocaleName = 'en') => {
{
label: lang.view,
submenu: [
// {
// label: 'Reload',
// accelerator: 'CmdOrCtrl+R',
// click (item, focusedWindow) {
// if (focusedWindow) focusedWindow.reload()
// }
// },
// {
// label: 'Toggle Developer Tools',
// accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
// click (item, focusedWindow) {
// if (focusedWindow) focusedWindow.webContents.toggleDevTools()
// }
// },
// {
// type: 'separator'
// },
{
label: lang.reload,
accelerator: 'CmdOrCtrl+R',
click (item: MenuItem, focusedWindow: BrowserWindow | undefined) {
if (focusedWindow) focusedWindow.reload()
},
},
{
label: lang.toggle_developer_tools,// 'Toggle Developer Tools',
accelerator: process.platform === 'darwin'
? 'Alt+Command+I'
: 'Ctrl+Shift+I',
click (item: MenuItem, focusedWindow: BrowserWindow | undefined) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools()
},
},
{
type: 'separator',
},
{
role: 'resetZoom',
label: lang.reset_zoom,
Expand Down Expand Up @@ -306,33 +308,14 @@ export const makeMainMenu = (locale: LocaleName = 'en') => {
submenu.splice(0, 4)
}

if (isDev()) {
// VIEW
// @ts-ignore
template[3].submenu = [
{
label: lang.reload,
accelerator: 'CmdOrCtrl+R',
click (item: MenuItem, focusedWindow: BrowserWindow) {
if (focusedWindow) focusedWindow.reload()
},
},
{
label: lang.toggle_developer_tools,// 'Toggle Developer Tools',
accelerator: process.platform === 'darwin'
? 'Alt+Command+I'
: 'Ctrl+Shift+I',
click (item: MenuItem, focusedWindow: BrowserWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools()
},
},
{
type: 'separator',
},
// @ts-ignore
...template[3].submenu,
]
}
// if (isDev()) {
// // VIEW
// // @ts-ignore
// template[3].submenu = [
// // @ts-ignore
// ...template[3].submenu,
// ]
// }

const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
Expand Down
2 changes: 1 addition & 1 deletion src/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[4, 0, 2, 6053]
[4, 0, 2, 6054]

0 comments on commit da1e639

Please sign in to comment.