forked from Shinonome/dots-hyprland
This commit is contained in:
@@ -84,7 +84,7 @@ Scope {
|
|||||||
|
|
||||||
function setSearchingText(text) {
|
function setSearchingText(text) {
|
||||||
searchWidget.setSearchingText(text);
|
searchWidget.setSearchingText(text);
|
||||||
searchWidget.focusFirstItemIfNeeded();
|
searchWidget.focusFirstItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|||||||
@@ -75,9 +75,8 @@ Item { // Wrapper
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
function focusFirstItemIfNeeded() {
|
function focusFirstItem() {
|
||||||
if (searchInput.focus)
|
appResults.currentIndex = 0;
|
||||||
appResults.currentIndex = 0; // Focus the first item
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
@@ -99,7 +98,7 @@ Item { // Wrapper
|
|||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
onRead: data => {
|
onRead: data => {
|
||||||
root.mathResult = data;
|
root.mathResult = data;
|
||||||
root.focusFirstItemIfNeeded();
|
root.focusFirstItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,6 +276,9 @@ Item { // Wrapper
|
|||||||
|
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
id: model
|
id: model
|
||||||
|
onValuesChanged: {
|
||||||
|
root.focusFirstItem();
|
||||||
|
}
|
||||||
values: {
|
values: {
|
||||||
// Search results are handled here
|
// Search results are handled here
|
||||||
////////////////// Skip? //////////////////
|
////////////////// Skip? //////////////////
|
||||||
@@ -405,8 +407,6 @@ Item { // Wrapper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onModelChanged: root.focusFirstItemIfNeeded()
|
|
||||||
|
|
||||||
delegate: SearchItem {
|
delegate: SearchItem {
|
||||||
// The selectable item for each search result
|
// The selectable item for each search result
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|||||||
Reference in New Issue
Block a user