From 05c5109331bd519f90c7e5b6fde559f458a6bbbe Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 5 Dec 2024 00:02:45 +0200 Subject: [PATCH] feat(native-buttons): adjustable offset --- src/public/app/desktop.js | 4 +++- src/public/stylesheets/style.css | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/public/app/desktop.js b/src/public/app/desktop.js index 560c2e529..cbd5b6f79 100644 --- a/src/public/app/desktop.js +++ b/src/public/app/desktop.js @@ -68,7 +68,9 @@ function initTitleBarButtons() { } // FIXME: call only on darwin - currentWindow.setWindowButtonPosition({ x: 20, y: 20 }); + const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10); + const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10); + currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset }); } // Update the native title bar buttons. diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 9d6a515eb..b8a83a3fa 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -41,6 +41,8 @@ body { --native-titlebar-background: var(--main-background-color); --native-titlebar-foreground: var(--main-text-color); + --native-titlebar-darwin-x-offset: 10; + --native-titlebar-darwin-y-offset: 12; } body.layout-horizontal {