Can enable dark mode

This commit is contained in:
Pierre HUBERT 2019-02-11 18:43:03 +01:00
parent 33b8e4e2b6
commit e01f521192

View File

@ -15,27 +15,53 @@ const {app, Menu} = require('electron');
module.exports.Get = function(window){ module.exports.Get = function(window){
return Menu.buildFromTemplate([ return Menu.buildFromTemplate([
//File menu
{ {
label: "File", label: "File",
submenu: [ submenu: [
//Close app
{ {
label: "Quit", label: "Quit",
click: () => { click: () => {
app.quit(); app.quit();
} }
} }
] ]
}, },
//Settings menu
{
label: "Settings",
submenu: [
//Dark mode
{
label: "Toggle dark mode",
click: () => {
window.webContents.executeJavaScript("ComunicWeb.components.darkTheme.setEnabled(!ComunicWeb.components.darkTheme.isEnabled());");
}
}
]
},
//Advanced menu
{ {
label: "Advanced", label: "Advanced",
submenu: [ submenu: [
//Dev tools
{ {
label: "Toggle developer tools", label: "Toggle developer tools",
click: () => { click: () => {
window.webContents.toggleDevTools(); window.webContents.toggleDevTools();
} }
} }
] ]
} }
]) ])