Introduces a dedicated layer-shell `WindowChromeSurface` that renders macOS-style traffic-light controls over the focused Sway window titlebar, replacing the old top-bar window controls. Adds theme tokens and a reusable `TrafficLightButton` component, updates shell QML/CMake wiring, and adjusts Sway titlebar padding/title format so window titles do not overlap the overlay. Window tracking was extended with focused-window geometry/deco/fullscreen properties plus backend refresh support so the chrome follows window movement and state changes in near real time.
49 lines
1.4 KiB
QML
49 lines
1.4 KiB
QML
import QtQuick
|
|
import Nebula.UI
|
|
import Nebula.Windows
|
|
|
|
Item {
|
|
id: root
|
|
|
|
readonly property bool maximized: WindowService.focusedWindowMaximized
|
|
readonly property bool hovered: closeButton.hovered || minimizeButton.hovered || zoomButton.hovered
|
|
|
|
implicitWidth: row.implicitWidth
|
|
implicitHeight: row.implicitHeight
|
|
Accessible.role: Accessible.Grouping
|
|
Accessible.name: qsTr("Window controls")
|
|
|
|
Row {
|
|
id: row
|
|
anchors.centerIn: parent
|
|
spacing: Theme.trafficLightGap
|
|
|
|
TrafficLightButton {
|
|
id: closeButton
|
|
fill: Theme.trafficClose
|
|
glyph: "close"
|
|
label: qsTr("Close")
|
|
showGlyph: root.hovered
|
|
onClicked: WindowService.closeFocusedWindow()
|
|
}
|
|
|
|
TrafficLightButton {
|
|
id: minimizeButton
|
|
fill: Theme.trafficMinimise
|
|
glyph: "minimize"
|
|
label: qsTr("Minimise")
|
|
showGlyph: root.hovered
|
|
onClicked: WindowService.minimizeFocusedWindow()
|
|
}
|
|
|
|
TrafficLightButton {
|
|
id: zoomButton
|
|
fill: Theme.trafficZoom
|
|
glyph: root.maximized ? "restore" : "zoom"
|
|
label: root.maximized ? qsTr("Restore") : qsTr("Maximise")
|
|
showGlyph: root.hovered
|
|
onClicked: WindowService.toggleMaximizeFocusedWindow()
|
|
}
|
|
}
|
|
}
|