mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-09 15:08:31 -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;
|
contentVisible = true;
|
||||||
spotlightContent.closeTransientUi?.();
|
spotlightContent.closeTransientUi?.();
|
||||||
|
|
||||||
|
const targetQuery = query || (SettingsData.rememberLastQuery ? (SessionData.launcherLastQuery || "") : "");
|
||||||
|
|
||||||
if (spotlightContent.searchField) {
|
if (spotlightContent.searchField) {
|
||||||
spotlightContent.searchField.text = query;
|
spotlightContent.searchField.text = targetQuery;
|
||||||
}
|
}
|
||||||
if (spotlightContent.controller) {
|
if (spotlightContent.controller) {
|
||||||
var targetMode = mode || SessionData.getLauncherRestoreMode();
|
var targetMode = mode || SessionData.getLauncherRestoreMode();
|
||||||
@@ -375,8 +377,8 @@ Item {
|
|||||||
spotlightContent.controller.collapsedSections = {};
|
spotlightContent.controller.collapsedSections = {};
|
||||||
spotlightContent.controller.selectedFlatIndex = 0;
|
spotlightContent.controller.selectedFlatIndex = 0;
|
||||||
spotlightContent.controller.selectedItem = null;
|
spotlightContent.controller.selectedItem = null;
|
||||||
if (query) {
|
if (targetQuery) {
|
||||||
spotlightContent.controller.setSearchQuery(query);
|
spotlightContent.controller.setSearchQuery(targetQuery);
|
||||||
} else {
|
} else {
|
||||||
spotlightContent.controller.searchQuery = "";
|
spotlightContent.controller.searchQuery = "";
|
||||||
spotlightContent.controller.performSearch();
|
spotlightContent.controller.performSearch();
|
||||||
@@ -422,8 +424,10 @@ Item {
|
|||||||
|
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
root.keyboardActive = true;
|
root.keyboardActive = true;
|
||||||
if (root.spotlightContent && root.spotlightContent.searchField)
|
if (root.spotlightContent && root.spotlightContent.searchField) {
|
||||||
root.spotlightContent.searchField.forceActiveFocus();
|
root.spotlightContent.searchField.forceActiveFocus();
|
||||||
|
root.spotlightContent.searchField.selectAll();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ Item {
|
|||||||
}
|
}
|
||||||
if (spotlightContent.searchField) {
|
if (spotlightContent.searchField) {
|
||||||
spotlightContent.searchField.forceActiveFocus();
|
spotlightContent.searchField.forceActiveFocus();
|
||||||
spotlightContent.searchField.cursorPosition = spotlightContent.searchField.text.length;
|
spotlightContent.searchField.selectAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ Item {
|
|||||||
|
|
||||||
if (spotlightContent.searchField) {
|
if (spotlightContent.searchField) {
|
||||||
spotlightContent.searchField.text = targetQuery;
|
spotlightContent.searchField.text = targetQuery;
|
||||||
|
spotlightContent.searchField.selectAll();
|
||||||
}
|
}
|
||||||
if (spotlightContent.controller) {
|
if (spotlightContent.controller) {
|
||||||
var targetMode = mode || SessionData.getLauncherRestoreMode();
|
var targetMode = mode || SessionData.getLauncherRestoreMode();
|
||||||
|
|||||||
Reference in New Issue
Block a user