feat(electron): load overlay information from CSS

This commit is contained in:
Elian Doran
2024-12-01 02:36:00 +02:00
parent 60192977c9
commit 01512152ea
2 changed files with 6 additions and 3 deletions

View File

@@ -50,10 +50,11 @@ function initOnElectron() {
// Update the native title bar buttons.
const electronRemote = utils.dynamicRequire("@electron/remote");
const currentWindow = electronRemote.getCurrentWindow();
const documentStyle = window.getComputedStyle(document.documentElement);
currentWindow.setTitleBarOverlay({
color: "red",
symbolColor: "white"
color: documentStyle.getPropertyValue("--native-titlebar-background"),
symbolColor: documentStyle.getPropertyValue("--native-titlebar-foreground")
});
console.log("Electron initialized.");
}