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

launcher: don't select pre-filled queries, exclude from memory

port 1.5
This commit is contained in:
bbedward
2026-07-13 10:31:17 -04:00
parent 06c0ea2afb
commit ea66b136ba
9 changed files with 107 additions and 16 deletions
@@ -36,6 +36,7 @@ Item {
property int viewModeVersion: 0
property string viewModeContext: "spotlight"
property bool forceLinearNavigation: false
property bool explicitQuerySession: false
signal itemExecuted
signal searchCompleted
@@ -54,7 +55,7 @@ Item {
if (active)
return;
SessionData.addLauncherHistory(searchQuery);
SessionData.addLauncherHistory(searchQuery, explicitQuerySession);
sections = [];
flatModel = [];
selectedItem = null;
@@ -1940,7 +1941,7 @@ Item {
if (!item)
return;
SessionData.addLauncherHistory(searchQuery);
SessionData.addLauncherHistory(searchQuery, explicitQuerySession);
if (item.type === "plugin_browse") {
var browsePluginId = item.data?.pluginId;
@@ -370,6 +370,7 @@ Item {
}
if (spotlightContent.controller) {
var targetMode = mode || SessionData.getLauncherRestoreMode();
spotlightContent.controller.explicitQuerySession = !!query;
spotlightContent.controller.searchMode = targetMode;
spotlightContent.controller.activePluginId = "";
spotlightContent.controller.activePluginName = "";
@@ -430,7 +431,10 @@ Item {
root.keyboardActive = true;
if (root.spotlightContent && root.spotlightContent.searchField) {
root.spotlightContent.searchField.forceActiveFocus();
root.spotlightContent.searchField.selectAll();
if (query)
root.spotlightContent.searchField.cursorPosition = root.spotlightContent.searchField.text.length;
else
root.spotlightContent.searchField.selectAll();
}
});
});
@@ -161,6 +161,7 @@ Item {
}
if (spotlightContent.controller) {
spotlightContent.controller.reset();
spotlightContent.controller.explicitQuerySession = !!query;
spotlightContent.controller.searchMode = targetMode;
spotlightContent.controller.historyIndex = -1;
if (targetQuery.length > 0)
@@ -171,7 +172,10 @@ Item {
}
if (spotlightContent.searchField) {
spotlightContent.searchField.forceActiveFocus();
spotlightContent.searchField.selectAll();
if (query)
spotlightContent.searchField.cursorPosition = targetQuery.length;
else
spotlightContent.searchField.selectAll();
}
}
@@ -154,10 +154,14 @@ Item {
if (spotlightContent.searchField) {
spotlightContent.searchField.text = targetQuery;
spotlightContent.searchField.selectAll();
if (query)
spotlightContent.searchField.cursorPosition = targetQuery.length;
else
spotlightContent.searchField.selectAll();
}
if (spotlightContent.controller) {
var targetMode = mode || SessionData.getLauncherRestoreMode();
spotlightContent.controller.explicitQuerySession = !!query;
spotlightContent.controller.searchMode = targetMode;
spotlightContent.controller.activePluginId = "";
spotlightContent.controller.activePluginName = "";