From c832b66159e52503ca3da4b8f9fa7d32dbd28353 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 17 Oct 2026 10:07:55 +0200 Subject: 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 --- desktop/Settings.qml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'desktop/Settings.qml') 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 { -- cgit v1.2.3