1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

fix(spotlight): select last query text on open; last-query persistence in connected frame mode (#2726)

* fix(spotlight): Fixes 'remember last query' being ignored in connected frame mode."

* fix(spotlight): select remembered query text instead of placing cursor at end
This commit is contained in:
Legend-017
2026-07-02 20:39:35 +05:00
committed by GitHub
parent 83b9cdcb27
commit a98417d66b
3 changed files with 10 additions and 5 deletions
@@ -359,8 +359,10 @@ Item {
contentVisible = true;
spotlightContent.closeTransientUi?.();
const targetQuery = query || (SettingsData.rememberLastQuery ? (SessionData.launcherLastQuery || "") : "");
if (spotlightContent.searchField) {
spotlightContent.searchField.text = query;
spotlightContent.searchField.text = targetQuery;
}
if (spotlightContent.controller) {
var targetMode = mode || SessionData.getLauncherRestoreMode();
@@ -375,8 +377,8 @@ Item {
spotlightContent.controller.collapsedSections = {};
spotlightContent.controller.selectedFlatIndex = 0;
spotlightContent.controller.selectedItem = null;
if (query) {
spotlightContent.controller.setSearchQuery(query);
if (targetQuery) {
spotlightContent.controller.setSearchQuery(targetQuery);
} else {
spotlightContent.controller.searchQuery = "";
spotlightContent.controller.performSearch();
@@ -422,8 +424,10 @@ Item {
Qt.callLater(() => {
root.keyboardActive = true;
if (root.spotlightContent && root.spotlightContent.searchField)
if (root.spotlightContent && root.spotlightContent.searchField) {
root.spotlightContent.searchField.forceActiveFocus();
root.spotlightContent.searchField.selectAll();
}
});
});
}
@@ -155,7 +155,7 @@ Item {
}
if (spotlightContent.searchField) {
spotlightContent.searchField.forceActiveFocus();
spotlightContent.searchField.cursorPosition = spotlightContent.searchField.text.length;
spotlightContent.searchField.selectAll();
}
}
@@ -139,6 +139,7 @@ Item {
if (spotlightContent.searchField) {
spotlightContent.searchField.text = targetQuery;
spotlightContent.searchField.selectAll();
}
if (spotlightContent.controller) {
var targetMode = mode || SessionData.getLauncherRestoreMode();