Browse Source

Update condition for linux menu on prod

master
meriadec 7 years ago
parent
commit
ea6c5064a7
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 92
      src/main/menu.js

92
src/main/menu.js

@ -19,51 +19,57 @@ const template = [
], ],
[], [],
), ),
...props(process.platform === 'darwin' || __DEV__, [ ...props(
{ process.platform === 'darwin' || __DEV__,
role: 'window', [
submenu: [ {
...props( role: 'window',
__DEV__, submenu: [
[ ...props(
{ __DEV__,
label: 'App Dev Tools', [
click() { {
const devWindow = BrowserWindow.getAllWindows().find(w => w.name === 'DevWindow') label: 'App Dev Tools',
if (devWindow) { click() {
devWindow.show() const devWindow = BrowserWindow.getAllWindows().find(w => w.name === 'DevWindow')
} if (devWindow) {
devWindow.show()
}
},
}, },
}, {
{ label: 'Main Window Dev Tools',
label: 'Main Window Dev Tools', click() {
click() { const mainWindow = BrowserWindow.getAllWindows().find(
const mainWindow = BrowserWindow.getAllWindows().find(w => w.name === 'MainWindow') w => w.name === 'MainWindow',
if (mainWindow) { )
mainWindow.openDevTools({ if (mainWindow) {
mode: process.env.DEV_TOOLS_MODE, mainWindow.openDevTools({
}) mode: process.env.DEV_TOOLS_MODE,
} })
}
},
}, },
}, ...props(process.platform === 'darwin', [{ type: 'separator' }], []),
...props(process.platform === 'darwin', [{ type: 'separator' }], []), ],
], [],
[], ),
), ...props(
...props( process.platform === 'darwin',
process.platform === 'darwin', [
[ { role: 'close' },
{ role: 'close' }, { role: 'minimize' },
{ role: 'minimize' }, { role: 'zoom' },
{ role: 'zoom' }, { type: 'separator' },
{ type: 'separator' }, { role: 'front' },
{ role: 'front' }, ],
], [],
[], ),
), ],
], },
}, ],
]), [],
),
] ]
export default Menu.buildFromTemplate(template) export default Menu.buildFromTemplate(template)

Loading…
Cancel
Save