diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index f78c29f7..408e75b6 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -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" diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 9feccf61..a5ee2fdf 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -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 }, diff --git a/quickshell/DMSShell.qml b/quickshell/DMSShell.qml index b0a5feb6..059e43ab 100644 --- a/quickshell/DMSShell.qml +++ b/quickshell/DMSShell.qml @@ -531,11 +531,6 @@ Item { PopoutService.dankLauncherV2Modal = dankLauncherV2Modal; PopoutService._onDankLauncherV2ModalLoaded(); } - - onDialogClosed: { - if (SettingsData.dankLauncherV2UnloadOnClose) - PopoutService.unloadDankLauncherV2(); - } } } diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml index ad401754..cf7f3a12 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml @@ -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 => { diff --git a/quickshell/Modals/DankLauncherV2/LauncherContent.qml b/quickshell/Modals/DankLauncherV2/LauncherContent.qml index 1444cbbd..2a4b64d6 100644 --- a/quickshell/Modals/DankLauncherV2/LauncherContent.qml +++ b/quickshell/Modals/DankLauncherV2/LauncherContent.qml @@ -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) => { diff --git a/quickshell/Modals/DankLauncherV2/Scorer.js b/quickshell/Modals/DankLauncherV2/Scorer.js index 16033f03..affc1ad7 100644 --- a/quickshell/Modals/DankLauncherV2/Scorer.js +++ b/quickshell/Modals/DankLauncherV2/Scorer.js @@ -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