mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28: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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user