diff options
Diffstat (limited to 'desktop')
| -rw-r--r-- | desktop/Settings.qml | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/desktop/Settings.qml b/desktop/Settings.qml index 22af3da..c6d4b19 100644 --- a/desktop/Settings.qml +++ b/desktop/Settings.qml @@ -95,6 +95,7 @@ Scope { active: root.open FloatingWindow { + id: win title: "Settings" implicitWidth: 900 implicitHeight: 640 @@ -108,8 +109,55 @@ Scope { onActivated: root.close() } + // A titlebar of its own, since Hyprland draws none: maximize, to + // fill the monitor and back, and close. + Row { + id: titlebar + anchors { top: parent.top; right: parent.right; topMargin: 8; rightMargin: 12 } + height: 28 + spacing: 6 + + Repeater { + // nf-fa-compress / nf-fa-expand and nf-fa-xmark, present + // in Inconsolata Nerd Font. + model: [ + { icon: win.maximized ? "\uf066" : "\uf065", act: () => win.maximized = !win.maximized, danger: false }, + { icon: "\uf00d", act: () => root.close(), danger: true }, + ] + Rectangle { + required property var modelData + width: 28 + height: 28 + radius: 14 + color: btnArea.containsMouse ? Qt.alpha(modelData.danger ? Theme.red : Theme.accent, 0.25) : "transparent" + + Text { + anchors.centerIn: parent + text: parent.modelData.icon + font { family: Theme.iconFamily; pixelSize: Theme.fontSize - 2 } + color: Theme.text + } + + MouseArea { + id: btnArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: parent.modelData.act() + } + } + } + } + + Text { + anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: titlebar.verticalCenter } + text: "Keystone Settings" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + color: Theme.subtext + } + Item { - anchors.fill: parent + anchors { top: titlebar.bottom; left: parent.left; right: parent.right; bottom: parent.bottom } focus: true Keys.onEscapePressed: root.back() |
