2019-02-11 17:38:00 +00:00
|
|
|
/**
|
|
|
|
* Application menu
|
|
|
|
*
|
|
|
|
* @author Comunic Authors
|
|
|
|
*/
|
|
|
|
|
|
|
|
const {app, Menu} = require('electron');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get application menu
|
|
|
|
*
|
|
|
|
* @param {BrowserWindow} window
|
|
|
|
* @return {Menu} Application menu
|
|
|
|
*/
|
|
|
|
module.exports.Get = function(window){
|
|
|
|
|
|
|
|
return Menu.buildFromTemplate([
|
2019-02-11 17:43:03 +00:00
|
|
|
|
|
|
|
//File menu
|
2019-02-11 17:38:00 +00:00
|
|
|
{
|
|
|
|
label: "File",
|
|
|
|
submenu: [
|
2019-02-11 17:43:03 +00:00
|
|
|
|
|
|
|
//Close app
|
2019-02-11 17:38:00 +00:00
|
|
|
{
|
|
|
|
label: "Quit",
|
|
|
|
click: () => {
|
|
|
|
app.quit();
|
|
|
|
}
|
|
|
|
}
|
2019-02-11 17:43:03 +00:00
|
|
|
|
2019-02-11 17:38:00 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2019-02-11 17:43:03 +00:00
|
|
|
|
|
|
|
//Settings menu
|
|
|
|
{
|
|
|
|
label: "Settings",
|
|
|
|
submenu: [
|
|
|
|
|
|
|
|
//Dark mode
|
|
|
|
{
|
|
|
|
label: "Toggle dark mode",
|
|
|
|
click: () => {
|
|
|
|
window.webContents.executeJavaScript("ComunicWeb.components.darkTheme.setEnabled(!ComunicWeb.components.darkTheme.isEnabled());");
|
|
|
|
}
|
2019-02-11 17:47:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//Incognito mode
|
|
|
|
{
|
|
|
|
label: "Enable incognito mode",
|
|
|
|
sublabel: "F6",
|
|
|
|
click: () => {
|
|
|
|
window.webContents.executeJavaScript("ComunicWeb.components.incognito.ui.confirmEnable();");
|
|
|
|
}
|
2019-02-11 17:43:03 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//Advanced menu
|
2019-02-11 17:38:00 +00:00
|
|
|
{
|
|
|
|
label: "Advanced",
|
|
|
|
submenu: [
|
2019-02-11 17:43:03 +00:00
|
|
|
|
|
|
|
//Dev tools
|
2019-02-11 17:38:00 +00:00
|
|
|
{
|
|
|
|
label: "Toggle developer tools",
|
|
|
|
click: () => {
|
|
|
|
window.webContents.toggleDevTools();
|
|
|
|
}
|
|
|
|
}
|
2019-02-11 17:43:03 +00:00
|
|
|
|
2019-02-11 17:38:00 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
])
|
|
|
|
|
|
|
|
}
|