aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Settings.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-17 10:07:55 +0200
committerDanilo M. <danix@danix.xyz>2026-10-17 10:07:55 +0200
commitc832b66159e52503ca3da4b8f9fa7d32dbd28353 (patch)
treef023a4274552f5fcb31481e819f97af3f1d78b1f /desktop/Settings.qml
parent1c68c391cd10b5726d082d487b97e7decb823512 (diff)
downloadquickshell-c832b66159e52503ca3da4b8f9fa7d32dbd28353.tar.gz
quickshell-c832b66159e52503ca3da4b8f9fa7d32dbd28353.zip
desktop: a clear button in the settings search
A small x at the right of the field while something is typed. Clearing puts the focus back in the field, ready for the next search. Escape still clears from the keyboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Settings.qml')
-rw-r--r--desktop/Settings.qml20
1 files changed, 19 insertions, 1 deletions
diff --git a/desktop/Settings.qml b/desktop/Settings.qml
index 9882193..2e6d1f1 100644
--- a/desktop/Settings.qml
+++ b/desktop/Settings.qml
@@ -106,7 +106,7 @@ Scope {
TextInput {
id: searchIn
- anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ anchors { fill: parent; leftMargin: 10; rightMargin: 30 }
verticalAlignment: TextInput.AlignVCenter
clip: true
selectByMouse: true
@@ -127,6 +127,24 @@ Scope {
font: parent.font
}
}
+
+ // Clear, there only while something is typed.
+ Text {
+ anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
+ visible: root.query !== ""
+ // nf-fa-xmark, present in Inconsolata Nerd Font.
+ text: ""
+ font { family: Theme.iconFamily; pixelSize: Theme.fontSize - 2 }
+ color: clearArea.containsMouse ? Theme.text : Theme.subtext
+
+ MouseArea {
+ id: clearArea
+ anchors { fill: parent; margins: -6 }
+ hoverEnabled: true
+ cursorShape: Qt.PointingHandCursor
+ onClicked: { root.query = ""; searchIn.forceActiveFocus(); }
+ }
+ }
}
ListView {