This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
183 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
const {app} = require('electron'); | ||
|
||
/** main app menu */ | ||
class AppMenu { | ||
/** construct main Menu template. | ||
* @return {Array} the menu template. | ||
*/ | ||
static mainMenu() { | ||
const template = [ | ||
{ | ||
label: 'File', | ||
submenu: [ | ||
{label: 'Connect to Twitch…'}, | ||
{label: 'Disconnect from Twitch'}, | ||
{label: 'Settings'}, | ||
{type: 'separator'}, | ||
{role: 'quit'}, | ||
], | ||
}, | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{role: 'undo'}, | ||
{role: 'redo'}, | ||
], | ||
}, | ||
{ | ||
label: 'View', | ||
submenu: [ | ||
{role: 'reload'}, | ||
{role: 'forcereload'}, | ||
{role: 'toggledevtools'}, | ||
{type: 'separator'}, | ||
{role: 'resetzoom'}, | ||
{role: 'zoomin'}, | ||
{role: 'zoomout'}, | ||
{type: 'separator'}, | ||
{role: 'togglefullscreen'}, | ||
], | ||
}, | ||
{ | ||
role: 'window', | ||
submenu: [ | ||
{role: 'minimize'}, | ||
{role: 'close'}, | ||
], | ||
}, | ||
{ | ||
role: 'help', | ||
submenu: [ | ||
{ | ||
label: 'SourceCode @ Github', | ||
click() { | ||
require('electron').shell.openExternal('https://github.com/bmhm/alttpr-vue-twitch-chat-tracker'); | ||
}, | ||
}, | ||
{ | ||
label: 'ElectronJs', | ||
click() { | ||
require('electron').shell.openExternal('https://electronjs.org'); | ||
}, | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
if (process.platform === 'darwin') { | ||
template.unshift({ | ||
label: app.getName(), | ||
submenu: [ | ||
{role: 'about'}, | ||
{type: 'separator'}, | ||
{role: 'services', submenu: []}, | ||
{type: 'separator'}, | ||
{role: 'hide'}, | ||
{role: 'hideothers'}, | ||
{role: 'unhide'}, | ||
{type: 'separator'}, | ||
{role: 'quit'}, | ||
], | ||
}); | ||
|
||
// Edit menu | ||
template[1].submenu.push( | ||
{type: 'separator'}, | ||
{ | ||
label: 'Speech', | ||
submenu: [ | ||
{role: 'startspeaking'}, | ||
{role: 'stopspeaking'}, | ||
], | ||
} | ||
); | ||
|
||
// Window menu | ||
template[3].submenu = [ | ||
{role: 'close'}, | ||
{role: 'minimize'}, | ||
{role: 'zoom'}, | ||
{type: 'separator'}, | ||
{role: 'front'}, | ||
]; | ||
} | ||
|
||
return template; | ||
} | ||
} | ||
|
||
|
||
export default AppMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters