From 373da07ed37b940d97bfc0e5e92cd4e602e2484e Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Sat, 9 Nov 2024 22:38:00 +0100 Subject: [PATCH] Implement dark theme support for window background color --- packages/main/window.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/main/window.ts b/packages/main/window.ts index 1845b691..2683ca30 100644 --- a/packages/main/window.ts +++ b/packages/main/window.ts @@ -5,6 +5,7 @@ import { action, observable, runInAction } from "mobx"; import { getIcon } from "main/util"; import { + settings, settingsRegisterWindow, settingsSetWindowBoundsIntoParams } from "main/settings"; @@ -81,8 +82,10 @@ export function createWindow(params: IWindowParams) { if (!showHidden) { settingsSetWindowBoundsIntoParams(params.url, windowContructorParams); - windowContructorParams.icon = getIcon(); + if (settings.isDarkTheme) { + windowContructorParams.backgroundColor = "#212529"; + } } let browserWindow = new BrowserWindow(windowContructorParams); @@ -120,6 +123,10 @@ export function createWindow(params: IWindowParams) { if (!showHidden) { browserWindow.show(); + // browserWindow.once("ready-to-show", () => { + // browserWindow.show(); + // }); + if (!params.utilityWindow) { browserWindow.on("close", function (event: any) { if (isCrashed(browserWindow)) {