mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
feat(electron): load overlay information from CSS
This commit is contained in:
parent
60192977c9
commit
01512152ea
@ -50,10 +50,11 @@ function initOnElectron() {
|
|||||||
// Update the native title bar buttons.
|
// Update the native title bar buttons.
|
||||||
const electronRemote = utils.dynamicRequire("@electron/remote");
|
const electronRemote = utils.dynamicRequire("@electron/remote");
|
||||||
const currentWindow = electronRemote.getCurrentWindow();
|
const currentWindow = electronRemote.getCurrentWindow();
|
||||||
|
const documentStyle = window.getComputedStyle(document.documentElement);
|
||||||
currentWindow.setTitleBarOverlay({
|
currentWindow.setTitleBarOverlay({
|
||||||
color: "red",
|
color: documentStyle.getPropertyValue("--native-titlebar-background"),
|
||||||
symbolColor: "white"
|
symbolColor: documentStyle.getPropertyValue("--native-titlebar-foreground")
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Electron initialized.");
|
console.log("Electron initialized.");
|
||||||
}
|
}
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
--submenu-opening-delay: 300ms;
|
--submenu-opening-delay: 300ms;
|
||||||
|
--native-titlebar-background: var(--left-pane-background-color);
|
||||||
|
--native-titlebar-foreground: var(--main-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user