Skip to content

Build your personal knowledge base with Trilium Notes

feat(electron): load overlay information from CSS

Elian Doran01512152ea53
diff --git a/src/public/app/desktop.js b/src/public/app/desktop.js
index 313bee0348..aa9564c070 100644
--- a/src/public/app/desktop.js
+++ b/src/public/app/desktop.js
@@ -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.");
}
\ No newline at end of file
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index cb8cdd1aa4..87a2144d19 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -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 {