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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user