mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 04:09:15 -04:00
feat(Launcher/Spotlight): improve context keyboard navigation and mode persistence (#2467)
* feat(Spotlight): fix submenu keyboard navigation * feat(Launcher/Spotlight): disable persisting last mode when changed by triggers * feat(Launcher/Spotlight): add option to disable last mode being persisted * fix(Launcher/Spotlight): fix context menu keys navigation * fix(NiriOverviewOverlay): fix context menu keys navigation and position
This commit is contained in:
@@ -396,7 +396,7 @@ Item {
|
||||
spotlightContent.searchField.text = query;
|
||||
}
|
||||
if (spotlightContent.controller) {
|
||||
var targetMode = mode || SessionData.launcherLastMode || "all";
|
||||
var targetMode = mode || SessionData.getLauncherRestoreMode();
|
||||
spotlightContent.controller.searchMode = targetMode;
|
||||
spotlightContent.controller.activePluginId = "";
|
||||
spotlightContent.controller.activePluginName = "";
|
||||
@@ -539,8 +539,8 @@ Item {
|
||||
|
||||
Connections {
|
||||
target: spotlightContent?.controller ?? null
|
||||
function onModeChanged(mode) {
|
||||
if (spotlightContent.controller.autoSwitchedToFiles)
|
||||
function onModeChanged(mode, userInitiated) {
|
||||
if (!userInitiated || !SettingsData.rememberLastMode)
|
||||
return;
|
||||
SessionData.setLauncherLastMode(mode);
|
||||
}
|
||||
@@ -928,8 +928,12 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: event => root.spotlightContent?.activeContextMenu?.handleKey(event)
|
||||
|
||||
Keys.onEscapePressed: event => {
|
||||
root.hide();
|
||||
root.spotlightContent?.activeContextMenu?.handleKey(event);
|
||||
if (!event.accepted)
|
||||
root.hide();
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user