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
No known key found for this signature in database
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.");
}

View File

@ -21,6 +21,8 @@
:root {
--submenu-opening-delay: 300ms;
--native-titlebar-background: var(--left-pane-background-color);
--native-titlebar-foreground: var(--main-text-color);
}
html {