Skip to content
This repository was archived by the owner on Sep 17, 2020. It is now read-only.

Commit c7844aa

Browse files
committed
Sync drawin and windows menu options and formatting
1 parent 69e370b commit c7844aa

File tree

1 file changed

+30
-53
lines changed

1 file changed

+30
-53
lines changed

app/menu.js

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ export default class MenuBuilder {
7979
const subMenuViewDev = {
8080
label: 'View',
8181
submenu: [
82+
{ label: 'Reload', accelerator: 'Command+R', click: () => { this.mainWindow.webContents.reload(); } },
8283
{ label: 'Toggle App Developer Tools', accelerator: 'Alt+Ctrl+J', click: () => { this.mainWindow.toggleDevTools(); }},
8384
{ label: 'Toggle Page Developer Tools', accelerator: 'Alt+Ctrl+I', click: () => { this.mainWindow.webContents.send('toggle-devtools'); }},
84-
{ label: 'Reload', accelerator: 'Command+R', click: () => { this.mainWindow.webContents.reload(); } },
8585
{ label: 'Toggle Full Screen', accelerator: 'Ctrl+Command+F', click: () => { this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen()); } }
8686
]
8787
};
@@ -96,7 +96,6 @@ export default class MenuBuilder {
9696
label: 'Window',
9797
submenu: [
9898
{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' },
99-
{ label: 'Quit', accelerator: 'Command+Q', click: () => { app.quit(); } },
10099
{ type: 'separator' },
101100
{ label: 'Bring All to Front', selector: 'arrangeInFront:' }
102101
]
@@ -124,57 +123,35 @@ export default class MenuBuilder {
124123
}
125124

126125
buildDefaultTemplate() {
127-
const templateDefault = [{
128-
label: '&File',
129-
submenu: [{
130-
label: '&Open',
131-
click: () => { this.mainWindow.webContents.send('open-warc-dialog'); }
132-
}, {
133-
label: '&Quit',
134-
accelerator: 'Ctrl+W',
135-
click: () => {
136-
this.mainWindow.close();
137-
}
138-
}]
139-
}, {
140-
label: '&View',
141-
submenu: (process.env.NODE_ENV === 'development') ? [{
142-
label: '&Reload',
143-
accelerator: 'Ctrl+R',
144-
click: () => {
145-
this.mainWindow.webContents.reload();
146-
}
147-
}, {
148-
label: 'Toggle &Full Screen',
149-
accelerator: 'F11',
150-
click: () => {
151-
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
152-
}
153-
}, {
154-
label: 'Toggle &Developer Tools',
155-
accelerator: 'Alt+Ctrl+I',
156-
click: () => {
157-
this.mainWindow.toggleDevTools();
158-
}
159-
}] : [{
160-
label: 'Toggle &Full Screen',
161-
accelerator: 'F11',
162-
click: () => {
163-
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
164-
}
165-
}]
166-
}, {
167-
label: 'Help',
168-
submenu: [{
169-
label: 'Learn More',
170-
click: () => { this.mainWindow.webContents.send('change-location', '/help'); }
171-
}, {
172-
label: 'Webrecorder.io',
173-
click() {
174-
shell.openExternal('https://webrecorder.io');
175-
}
176-
}]
177-
}];
126+
const templateDefault = [
127+
{
128+
label: '&File',
129+
submenu: [
130+
{ label: 'Open', accelerator: 'Ctrl+O', click: () => { this.mainWindow.webContents.send('open-warc-dialog'); } }
131+
]
132+
},
133+
{
134+
label: '&View',
135+
submenu:
136+
(process.env.NODE_ENV === 'development') ? [
137+
{ label: 'Reload', accelerator: 'Ctrl+R', click: () => { this.mainWindow.webContents.reload(); } },
138+
{ label: 'Toggle Page Developer Tools', accelerator: 'Alt+Ctrl+I', click: () => { this.mainWindow.webContents.send('toggle-devtools'); }},
139+
{ label: 'Toggle App Developer Tools', accelerator: 'Alt+Ctrl+J', click: () => { this.mainWindow.toggleDevTools(); } },
140+
{ label: 'Toggle Full Screen', accelerator: 'F11', click: () => { this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());} }
141+
] :
142+
[
143+
{ label: 'Toggle Page Developer Tools', accelerator: 'Alt+Ctrl+I', click: () => { this.mainWindow.webContents.send('toggle-devtools'); } },
144+
{ label: 'Toggle Full Screen', accelerator: 'F11', click: () => { this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen()); } }
145+
]
146+
},
147+
{
148+
label: '&Help',
149+
submenu: [
150+
{ label: 'Learn More', click: () => { this.mainWindow.webContents.send('change-location', '/help'); } },
151+
{ label: 'Webrecorder.io', click() { shell.openExternal('https://webrecorder.io'); }
152+
}]
153+
}
154+
];
178155

179156
return templateDefault;
180157
}

0 commit comments

Comments
 (0)