Add white mode with a setting

This commit is contained in:
Jelle Glebbeek
2021-04-04 22:55:51 +02:00
parent 92fc7757cd
commit 12554431ac
8 changed files with 64 additions and 15 deletions

16
main.js
View File

@@ -125,7 +125,7 @@ function createWindow(env) {
minHeight: 650,
width: 815,
height: 800,
backgroundColor: '#212121',
backgroundColor: env.settings.theme === "dark" ? '#212121' : '#ffffff',
titleBarStyle: process.platform === "darwin" ? "hiddenInset" : "hidden",
frame: false,
icon: env.paths.icon,
@@ -146,10 +146,11 @@ function createWindow(env) {
win.on('closed', () => {
win = null
})
win.once('ready-to-show', () => {
win.show()
})
win.webContents.on('did-finish-load', () => startCriticalHandlers(env));
win.once('focus', () => win.flashFrame(false))
win.webContents.on('did-finish-load', () => {
win.show();
startCriticalHandlers(env)
});
}
app.on('ready', async () => {
@@ -209,6 +210,11 @@ ipcMain.handle("platform", () => {
return process.platform;
})
//Return the user selected theme to the renderer process
ipcMain.handle("theme", () => {
return env.settings.theme;
})
//Handle titlebar click events from the renderer process
ipcMain.handle('titlebarClick', (event, arg) => {
if(arg === 'close') {