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

Loading…
Cancel
Save