mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 10:12:07 -04:00
@@ -126,6 +126,10 @@ Singleton {
|
||||
property var hiddenOutputDeviceNames: []
|
||||
property var hiddenInputDeviceNames: []
|
||||
|
||||
property string launcherLastMode: "all"
|
||||
property string appDrawerLastMode: "apps"
|
||||
property string niriOverviewLastMode: "apps"
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!isGreeterMode) {
|
||||
loadSettings();
|
||||
@@ -1100,6 +1104,21 @@ Singleton {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setLauncherLastMode(mode) {
|
||||
launcherLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setAppDrawerLastMode(mode) {
|
||||
appDrawerLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setNiriOverviewLastMode(mode) {
|
||||
niriOverviewLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function syncWallpaperForCurrentMode() {
|
||||
if (!perModeWallpaper)
|
||||
return;
|
||||
|
||||
@@ -77,7 +77,11 @@ var SPEC = {
|
||||
|
||||
deviceMaxVolumes: { def: {} },
|
||||
hiddenOutputDeviceNames: { def: [] },
|
||||
hiddenInputDeviceNames: { def: [] }
|
||||
hiddenInputDeviceNames: { def: [] },
|
||||
|
||||
launcherLastMode: { def: "all" },
|
||||
appDrawerLastMode: { def: "apps" },
|
||||
niriOverviewLastMode: { def: "apps" }
|
||||
};
|
||||
|
||||
function getValidKeys() {
|
||||
|
||||
@@ -102,7 +102,7 @@ Item {
|
||||
spotlightContent.searchField.text = query;
|
||||
}
|
||||
if (spotlightContent.controller) {
|
||||
var targetMode = mode || "all";
|
||||
var targetMode = mode || SessionData.launcherLastMode || "all";
|
||||
spotlightContent.controller.searchMode = targetMode;
|
||||
spotlightContent.controller.activePluginId = "";
|
||||
spotlightContent.controller.activePluginName = "";
|
||||
@@ -230,6 +230,15 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: spotlightContent?.controller ?? null
|
||||
function onModeChanged(mode) {
|
||||
if (spotlightContent.controller.autoSwitchedToFiles)
|
||||
return;
|
||||
SessionData.setLauncherLastMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
HyprlandFocusGrab {
|
||||
id: focusGrab
|
||||
windows: [launcherWindow]
|
||||
|
||||
@@ -61,7 +61,7 @@ DankPopout {
|
||||
return;
|
||||
|
||||
const query = _pendingQuery;
|
||||
const mode = _pendingMode || "apps";
|
||||
const mode = _pendingMode || SessionData.appDrawerLastMode || "apps";
|
||||
_pendingMode = "";
|
||||
_pendingQuery = "";
|
||||
|
||||
@@ -83,6 +83,15 @@ DankPopout {
|
||||
lc.actionPanel?.hide();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: contentLoader.item?.launcherContent?.controller ?? null
|
||||
function onModeChanged(mode) {
|
||||
if (contentLoader.item.launcherContent.controller.autoSwitchedToFiles)
|
||||
return;
|
||||
SessionData.setAppDrawerLastMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
content: Component {
|
||||
Rectangle {
|
||||
id: contentContainer
|
||||
|
||||
@@ -127,7 +127,7 @@ Scope {
|
||||
onShouldShowSpotlightChanged: {
|
||||
if (shouldShowSpotlight) {
|
||||
if (launcherContent?.controller) {
|
||||
launcherContent.controller.searchMode = "apps";
|
||||
launcherContent.controller.searchMode = SessionData.niriOverviewLastMode || "apps";
|
||||
launcherContent.controller.performSearch();
|
||||
}
|
||||
return;
|
||||
@@ -308,6 +308,11 @@ Scope {
|
||||
function onItemExecuted() {
|
||||
niriOverviewScope.releaseKeyboard = true;
|
||||
}
|
||||
function onModeChanged(mode) {
|
||||
if (launcherContent.controller.autoSwitchedToFiles)
|
||||
return;
|
||||
SessionData.setNiriOverviewLastMode(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user