From e74481692846f600f32ff19b0e3352968fb8bc3f Mon Sep 17 00:00:00 2001 From: MrRogueKnight <89287357+MrRogueKnight@users.noreply.github.com> Date: Fri, 25 Jul 2025 01:53:31 +0530 Subject: [PATCH 1/2] Update SearchWidget.qml --- .config/quickshell/ii/modules/overview/SearchWidget.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/overview/SearchWidget.qml b/.config/quickshell/ii/modules/overview/SearchWidget.qml index 6e4c3cbf..491222ae 100644 --- a/.config/quickshell/ii/modules/overview/SearchWidget.qml +++ b/.config/quickshell/ii/modules/overview/SearchWidget.qml @@ -405,7 +405,12 @@ Item { // Wrapper } } - onModelChanged: root.focusFirstItemIfNeeded() + onModelChanged: { + root.focusFirstItemIfNeeded(); + if (root.searchingText.startsWith(Config.options.search.prefix.clipboard) && appResults.count > 0) { + appResults.positionViewAtIndex(0, ListView.Beginning); + } + } delegate: SearchItem { // The selectable item for each search result From d09259c79a4f53855b68f57c810b8395102486e7 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 25 Jul 2025 09:30:59 +0700 Subject: [PATCH 2/2] search: fix clipboard gets scrolled to bottom --- .../quickshell/ii/modules/overview/Overview.qml | 2 +- .../ii/modules/overview/SearchWidget.qml | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.config/quickshell/ii/modules/overview/Overview.qml b/.config/quickshell/ii/modules/overview/Overview.qml index 1af8cb9c..6fd58761 100644 --- a/.config/quickshell/ii/modules/overview/Overview.qml +++ b/.config/quickshell/ii/modules/overview/Overview.qml @@ -84,7 +84,7 @@ Scope { function setSearchingText(text) { searchWidget.setSearchingText(text); - searchWidget.focusFirstItemIfNeeded(); + searchWidget.focusFirstItem(); } ColumnLayout { diff --git a/.config/quickshell/ii/modules/overview/SearchWidget.qml b/.config/quickshell/ii/modules/overview/SearchWidget.qml index 491222ae..219ba0f7 100644 --- a/.config/quickshell/ii/modules/overview/SearchWidget.qml +++ b/.config/quickshell/ii/modules/overview/SearchWidget.qml @@ -75,9 +75,8 @@ Item { // Wrapper }, ] - function focusFirstItemIfNeeded() { - if (searchInput.focus) - appResults.currentIndex = 0; // Focus the first item + function focusFirstItem() { + appResults.currentIndex = 0; } Timer { @@ -99,7 +98,7 @@ Item { // Wrapper stdout: SplitParser { onRead: data => { root.mathResult = data; - root.focusFirstItemIfNeeded(); + root.focusFirstItem(); } } } @@ -277,6 +276,9 @@ Item { // Wrapper model: ScriptModel { id: model + onValuesChanged: { + root.focusFirstItem(); + } values: { // Search results are handled here ////////////////// Skip? ////////////////// @@ -405,13 +407,6 @@ Item { // Wrapper } } - onModelChanged: { - root.focusFirstItemIfNeeded(); - if (root.searchingText.startsWith(Config.options.search.prefix.clipboard) && appResults.count > 0) { - appResults.positionViewAtIndex(0, ListView.Beginning); - } - } - delegate: SearchItem { // The selectable item for each search result required property var modelData