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){
return Menu.buildFromTemplate([
//File menu
{
label: "File",
submenu: [
//Close app
{
label: "Quit",
click: () => {
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",
submenu: [
//Dev tools
{
label: "Toggle developer tools",
click: () => {
window.webContents.toggleDevTools();
}
}
]
}
])