Add application menu items to context menu (#208)

Co-authored-by: linonetwo <linonetwo012@gmail.com>
This commit is contained in:
Quang Lam 2020-04-27 20:06:13 +07:00 committed by GitHub
parent 99f2bb0c10
commit 4c90522f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ const {
const ContextMenuBuilder = require('../libs/context-menu-builder');
const { MenuItem } = remote;
const { MenuItem, shell } = remote;
window.global = {};
@ -124,6 +124,44 @@ document.addEventListener('DOMContentLoaded', () => {
},
}));
menu.append(new MenuItem({ type: 'separator' }));
menu.append(
new MenuItem({
label: 'More',
submenu: [
{
label: 'About',
click: () => ipcRenderer.send('request-show-about-window'),
},
{ type: 'separator' },
{
label: 'Check for Updates',
click: () => ipcRenderer.send('request-check-for-updates'),
},
{
label: 'Preferences...',
click: () => ipcRenderer.send('request-show-preferences-window'),
},
{ type: 'separator' },
{
label: 'Singlebox Support',
click: () => shell.openExternal('https://atomery.com/support?app=singlebox'),
},
{
label: 'Singlebox Website',
click: () => shell.openExternal('https://singleboxapp.com'),
},
{ type: 'separator' },
{
label: 'Quit',
click: () => ipcRenderer.send('request-quit'),
},
],
}),
);
menu.popup(remote.getCurrentWindow());
});
});