aboutsummaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-18 21:56:36 +0200
committerDanilo M. <danix@danix.xyz>2026-10-18 21:56:36 +0200
commit6c678fa9cd111df116b219383d396efbd48c7c34 (patch)
treec1601ed3d5f1344c69b15b81850a09ea4b6b2384 /desktop
parentb90bcb5ba7d7be8b80021b0332a646d016196743 (diff)
downloadquickshell-6c678fa9cd111df116b219383d396efbd48c7c34.tar.gz
quickshell-6c678fa9cd111df116b219383d396efbd48c7c34.zip
settings: titlebar row with maximize and close
Hyprland draws no decorations, so the settings window had no way to fill the monitor and no visible close (only Ctrl+Q and Escape). It now carries a titlebar row of its own: "Keystone Settings" centred, and maximize and close at the right. Maximize toggles FloatingWindow.maximized, which Hyprland honours and undoes. A corner button floating over the page was tried first and covered the pages' Save buttons; a row of its own keeps clear of every page header without each page knowing about it. The buttons are Rectangles rather than the directory's Button.qml, because this file imports QtQuick.Controls and that import shadows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Settings.qml50
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()