Introduces a new `WindowControls` component in the desktop top bar with minimize, maximize/restore, and close actions for the focused window. `WindowService` now exposes focused-window presence/maximized state plus focused-window convenience actions to support this UI. Also extends Nebula UI with a reusable `NebulaToolTip`, keyboard/pressed-state support in `NebulaIconButton`, new window-control glyphs in `NebulaIcon`, and theme tokens for pressed/danger hover states, with CMake and README updates to register/document the new components.
82 lines
2.0 KiB
QML
82 lines
2.0 KiB
QML
import QtQuick
|
|
import Nebula.UI
|
|
|
|
Item {
|
|
id: root
|
|
|
|
implicitHeight: Theme.topBarHeight
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
color: Theme.topBarBackground
|
|
|
|
Rectangle {
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
height: 1
|
|
color: Theme.border
|
|
}
|
|
}
|
|
|
|
Row {
|
|
id: left
|
|
anchors.left: parent.left
|
|
anchors.leftMargin: 6
|
|
anchors.right: right.left
|
|
anchors.rightMargin: 12
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: 8
|
|
|
|
NebulaButton {
|
|
id: nebulaButton
|
|
checked: ShellState.launcherOpen
|
|
onClicked: ShellState.toggleLauncher()
|
|
}
|
|
|
|
Rectangle {
|
|
id: leftDivider
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
width: 1
|
|
height: 14
|
|
color: Theme.borderStrong
|
|
}
|
|
|
|
Text {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
width: Math.min(implicitWidth, Math.max(0, left.width - nebulaButton.width - leftDivider.width - left.spacing * 2))
|
|
text: ShellState.activeApplication
|
|
color: Theme.textSecondary
|
|
font.family: Theme.fontFamily
|
|
font.pixelSize: Theme.fontSize
|
|
elide: Text.ElideRight
|
|
maximumLineCount: 1
|
|
}
|
|
}
|
|
|
|
Row {
|
|
id: right
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: 10
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: windowControls.visible ? 8 : 0
|
|
|
|
WindowControls {
|
|
id: windowControls
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
Rectangle {
|
|
visible: windowControls.visible
|
|
width: visible ? 1 : 0
|
|
height: 14
|
|
color: Theme.borderStrong
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
SystemArea {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|
|
}
|