From 7741fbcb5c09c501b30d4da98a5374135fc1f2f3 Mon Sep 17 00:00:00 2001 From: Andrew Zambazos Date: Wed, 26 Aug 2026 22:51:16 +1200 Subject: [PATCH] Refine window chrome position and sizing Updates UI theme metrics for traffic-light controls and chrome inset to slightly larger values. In the desktop window chrome surface, positioning now uses the title bar center directly, rounds rendered margins, and introduces short easing animations for X/Y chrome offsets to reduce jitter during movement. --- packages/nebula-ui/qml/Nebula/UI/Theme.qml | 6 ++--- .../qml/surfaces/WindowChromeSurface.qml | 23 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/packages/nebula-ui/qml/Nebula/UI/Theme.qml b/packages/nebula-ui/qml/Nebula/UI/Theme.qml index da82a3e..aea15ee 100644 --- a/packages/nebula-ui/qml/Nebula/UI/Theme.qml +++ b/packages/nebula-ui/qml/Nebula/UI/Theme.qml @@ -52,9 +52,9 @@ QtObject { readonly property int topBarHeight: 40 readonly property int controlHeight: 28 readonly property int searchHeight: 36 - readonly property int trafficLightSize: 18 - readonly property int trafficLightGap: 8 - readonly property int windowChromeInset: 12 + readonly property int trafficLightSize: 20 + readonly property int trafficLightGap: 9 + readonly property int windowChromeInset: 14 readonly property int fontSize: 13 readonly property int fontSizeApp: 12 diff --git a/shells/desktop/shell/qml/surfaces/WindowChromeSurface.qml b/shells/desktop/shell/qml/surfaces/WindowChromeSurface.qml index d6dad62..86aa064 100644 --- a/shells/desktop/shell/qml/surfaces/WindowChromeSurface.qml +++ b/shells/desktop/shell/qml/surfaces/WindowChromeSurface.qml @@ -14,9 +14,10 @@ Window { readonly property int chromeY: { const barY = WindowService.focusedWindowTitleBarY const barH = Math.max(WindowService.focusedWindowTitleBarHeight, height) - const centered = barY + Math.round((barH - height) / 2) - return centered - Theme.topBarHeight + return barY + Math.round((barH - height) / 2) } + property real renderedChromeX: chromeX + property real renderedChromeY: chromeY title: qsTr("Nebula Window Chrome") color: "transparent" @@ -28,11 +29,25 @@ Window { LayerShell.Window.scope: "nebula-window-chrome" LayerShell.Window.layer: LayerShell.Window.LayerTop LayerShell.Window.anchors: LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorTop - LayerShell.Window.margins.left: Math.max(0, chromeX) - LayerShell.Window.margins.top: Math.max(0, chromeY) + LayerShell.Window.margins.left: Math.max(0, Math.round(renderedChromeX)) + LayerShell.Window.margins.top: Math.max(0, Math.round(renderedChromeY)) LayerShell.Window.exclusionZone: 0 LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone + Behavior on renderedChromeX { + NumberAnimation { + duration: 34 + easing.type: Easing.OutQuad + } + } + + Behavior on renderedChromeY { + NumberAnimation { + duration: 34 + easing.type: Easing.OutQuad + } + } + WindowControls { id: controls anchors.centerIn: parent