1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -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 string dankLauncherV2BorderColor: "primary"
property bool dankLauncherV2ShowFooter: true
property bool dankLauncherV2UnloadOnClose: false
property bool dankLauncherV2UnloadOnClose: true
property string _legacyWeatherLocation: "New York, NY"
property string _legacyWeatherCoordinates: "40.7128,-74.0060"

View File

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

View File

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

View File

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

View File

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

View File

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