Files
Nebula-OS/shells/desktop/shell/qml/surfaces/WindowChromeSurface.qml
T
andrew 7741fbcb5c 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.
2026-08-26 22:51:16 +12:00

56 lines
1.8 KiB
QML

import QtQuick
import QtQuick.Window
import org.kde.layershell 1.0 as LayerShell
import Nebula.UI
import Nebula.Windows
Window {
id: root
readonly property bool active: WindowService.hasFocusedWindow
&& !WindowService.focusedWindowFullscreen
&& !ShellState.launcherOpen
readonly property int chromeX: WindowService.focusedWindowX + Theme.windowChromeInset
readonly property int chromeY: {
const barY = WindowService.focusedWindowTitleBarY
const barH = Math.max(WindowService.focusedWindowTitleBarHeight, height)
return barY + Math.round((barH - height) / 2)
}
property real renderedChromeX: chromeX
property real renderedChromeY: chromeY
title: qsTr("Nebula Window Chrome")
color: "transparent"
flags: Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
visible: root.active
width: Math.max(1, controls.implicitWidth)
height: Math.max(1, controls.implicitHeight)
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, 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
}
}