feat(native-buttons): differentiate background based on layout

This commit is contained in:
Elian Doran
2024-12-01 21:06:01 +02:00
parent e933b8d5c8
commit 8135fa09c3
5 changed files with 24 additions and 14 deletions

View File

@@ -57,10 +57,14 @@ function initTitleBarButtons() {
function applyTitleBarOverlaySettings() {
const electronRemote = utils.dynamicRequire("@electron/remote");
const currentWindow = electronRemote.getCurrentWindow();
const documentStyle = window.getComputedStyle(document.documentElement);
const color = documentStyle.getPropertyValue("--native-titlebar-background");
const symbolColor = documentStyle.getPropertyValue("--native-titlebar-foreground");
currentWindow.setTitleBarOverlay({ color, symbolColor });
const style = window.getComputedStyle(document.body);
const color = style.getPropertyValue("--native-titlebar-background");
const symbolColor = style.getPropertyValue("--native-titlebar-foreground");
if (color && symbolColor) {
currentWindow.setTitleBarOverlay({ color, symbolColor });
}
}
// Update the native title bar buttons.