1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-11 08:12:09 -04:00

launcher: try a more targeted unload approach

This commit is contained in:
bbedward
2026-02-15 15:48:49 -05:00
parent ebe1785411
commit 0d49acaaa8
6 changed files with 16 additions and 16 deletions

View File

@@ -314,7 +314,7 @@ Singleton {
property int dankLauncherV2BorderThickness: 2 property int dankLauncherV2BorderThickness: 2
property string dankLauncherV2BorderColor: "primary" property string dankLauncherV2BorderColor: "primary"
property bool dankLauncherV2ShowFooter: true property bool dankLauncherV2ShowFooter: true
property bool dankLauncherV2UnloadOnClose: false property bool dankLauncherV2UnloadOnClose: true
property string _legacyWeatherLocation: "New York, NY" property string _legacyWeatherLocation: "New York, NY"
property string _legacyWeatherCoordinates: "40.7128,-74.0060" property string _legacyWeatherCoordinates: "40.7128,-74.0060"

View File

@@ -173,7 +173,7 @@ var SPEC = {
dankLauncherV2BorderThickness: { def: 2 }, dankLauncherV2BorderThickness: { def: 2 },
dankLauncherV2BorderColor: { def: "primary" }, dankLauncherV2BorderColor: { def: "primary" },
dankLauncherV2ShowFooter: { def: true }, dankLauncherV2ShowFooter: { def: true },
dankLauncherV2UnloadOnClose: { def: false }, dankLauncherV2UnloadOnClose: { def: true },
useAutoLocation: { def: false }, useAutoLocation: { def: false },
weatherEnabled: { def: true }, weatherEnabled: { def: true },

View File

@@ -531,11 +531,6 @@ Item {
PopoutService.dankLauncherV2Modal = dankLauncherV2Modal; PopoutService.dankLauncherV2Modal = dankLauncherV2Modal;
PopoutService._onDankLauncherV2ModalLoaded(); PopoutService._onDankLauncherV2ModalLoaded();
} }
onDialogClosed: {
if (SettingsData.dankLauncherV2UnloadOnClose)
PopoutService.unloadDankLauncherV2();
}
} }
} }

View File

@@ -263,7 +263,7 @@ Item {
PanelWindow { PanelWindow {
id: launcherWindow id: launcherWindow
visible: root._windowEnabled && (!SettingsData.dankLauncherV2UnloadOnClose || spotlightOpen || isClosing) visible: root._windowEnabled
color: "transparent" color: "transparent"
exclusionMode: ExclusionMode.Ignore exclusionMode: ExclusionMode.Ignore
@@ -376,7 +376,9 @@ Item {
LauncherContent { LauncherContent {
id: launcherContent id: launcherContent
anchors.fill: parent anchors.fill: parent
focus: true
parentModal: root parentModal: root
heavyContentActive: !SettingsData.dankLauncherV2UnloadOnClose || spotlightOpen || isClosing
} }
Keys.onEscapePressed: event => { Keys.onEscapePressed: event => {

View File

@@ -12,10 +12,11 @@ FocusScope {
LayoutMirroring.childrenInherit: true LayoutMirroring.childrenInherit: true
property var parentModal: null property var parentModal: null
property bool heavyContentActive: true
property string viewModeContext: "spotlight" property string viewModeContext: "spotlight"
property alias searchField: searchField property alias searchField: searchField
property alias controller: controller property alias controller: controller
property alias resultsList: resultsList property var resultsList: resultsLoader.item
property alias actionPanel: actionPanel property alias actionPanel: actionPanel
property bool editMode: false property bool editMode: false
@@ -23,7 +24,8 @@ FocusScope {
property string editAppId: "" property string editAppId: ""
function resetScroll() { function resetScroll() {
resultsList.resetScroll(); if (resultsList)
resultsList.resetScroll();
} }
function focusSearchField() { function focusSearchField() {
@@ -222,7 +224,7 @@ FocusScope {
return; return;
case Qt.Key_Menu: case Qt.Key_Menu:
case Qt.Key_F10: case Qt.Key_F10:
if (contextMenu.hasContextMenuActions(controller.selectedItem)) { if (resultsList && contextMenu.hasContextMenuActions(controller.selectedItem)) {
var scenePos = resultsList.getSelectedItemPosition(); var scenePos = resultsList.getSelectedItemPosition();
var localPos = root.mapFromItem(null, scenePos.x, scenePos.y); var localPos = root.mapFromItem(null, scenePos.x, scenePos.y);
showContextMenu(controller.selectedItem, localPos.x, localPos.y, true); showContextMenu(controller.selectedItem, localPos.x, localPos.y, true);
@@ -551,14 +553,15 @@ FocusScope {
} }
} }
Item { Loader {
id: resultsLoader
width: parent.width width: parent.width
height: parent.height - searchField.height - categoryRow.height - actionPanel.height - Theme.spacingXS * (categoryRow.visible ? 3 : 2) height: parent.height - searchField.height - categoryRow.height - actionPanel.height - Theme.spacingXS * (categoryRow.visible ? 3 : 2)
active: root.heavyContentActive
asynchronous: false
opacity: root.parentModal?.isClosing ? 0 : 1 opacity: root.parentModal?.isClosing ? 0 : 1
ResultsList { sourceComponent: ResultsList {
id: resultsList
anchors.fill: parent
controller: root.controller controller: root.controller
onItemRightClicked: (index, item, sceneX, sceneY) => { onItemRightClicked: (index, item, sceneX, sceneY) => {

View File

@@ -152,7 +152,7 @@ function scoreItems(items, query, getFrecencyFn) {
var item = items[i] var item = items[i]
var itemScore var itemScore
if (item._preScored !== undefined) { if (query && item._preScored !== undefined) {
itemScore = item._preScored itemScore = item._preScored
} else { } else {
var frecencyData = getFrecencyFn ? getFrecencyFn(item) : null var frecencyData = getFrecencyFn ? getFrecencyFn(item) : null