mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 01:02:18 -04:00
fix(launcher): release DankLauncherV2 resources after close (#1692)
* fix(launcher): release DankLauncherV2 resources after close * launcher: make unload on close optional --------- Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
@@ -314,6 +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 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"
|
||||||
|
|||||||
@@ -173,6 +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 },
|
||||||
|
|
||||||
useAutoLocation: { def: false },
|
useAutoLocation: { def: false },
|
||||||
weatherEnabled: { def: true },
|
weatherEnabled: { def: true },
|
||||||
|
|||||||
@@ -531,6 +531,11 @@ Item {
|
|||||||
PopoutService.dankLauncherV2Modal = dankLauncherV2Modal;
|
PopoutService.dankLauncherV2Modal = dankLauncherV2Modal;
|
||||||
PopoutService._onDankLauncherV2ModalLoaded();
|
PopoutService._onDankLauncherV2ModalLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDialogClosed: {
|
||||||
|
if (SettingsData.dankLauncherV2UnloadOnClose)
|
||||||
|
PopoutService.unloadDankLauncherV2();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ Item {
|
|||||||
sections = [];
|
sections = [];
|
||||||
flatModel = [];
|
flatModel = [];
|
||||||
selectedItem = null;
|
selectedItem = null;
|
||||||
|
_clearModeCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import Quickshell.Wayland
|
|||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@@ -264,7 +263,7 @@ Item {
|
|||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: launcherWindow
|
id: launcherWindow
|
||||||
visible: root._windowEnabled
|
visible: root._windowEnabled && (!SettingsData.dankLauncherV2UnloadOnClose || spotlightOpen || isClosing)
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
|
||||||
|
|||||||
@@ -415,6 +415,15 @@ Item {
|
|||||||
onToggled: checked => SettingsData.set("dankLauncherV2ShowFooter", checked)
|
onToggled: checked => SettingsData.set("dankLauncherV2ShowFooter", checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
settingKey: "dankLauncherV2UnloadOnClose"
|
||||||
|
tags: ["launcher", "unload", "close", "memory", "vram"]
|
||||||
|
text: I18n.tr("Unload on Close")
|
||||||
|
description: I18n.tr("Free VRAM/memory when the launcher is closed. May cause a slight delay when reopening.")
|
||||||
|
checked: SettingsData.dankLauncherV2UnloadOnClose
|
||||||
|
onToggled: checked => SettingsData.set("dankLauncherV2UnloadOnClose", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "dankLauncherV2BorderEnabled"
|
settingKey: "dankLauncherV2BorderEnabled"
|
||||||
tags: ["launcher", "border", "outline"]
|
tags: ["launcher", "border", "outline"]
|
||||||
|
|||||||
@@ -454,6 +454,13 @@ Singleton {
|
|||||||
dankLauncherV2Modal?.hide();
|
dankLauncherV2Modal?.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unloadDankLauncherV2() {
|
||||||
|
if (dankLauncherV2ModalLoader) {
|
||||||
|
dankLauncherV2Modal = null;
|
||||||
|
dankLauncherV2ModalLoader.active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function toggleDankLauncherV2() {
|
function toggleDankLauncherV2() {
|
||||||
if (dankLauncherV2Modal) {
|
if (dankLauncherV2Modal) {
|
||||||
dankLauncherV2Modal.toggle();
|
dankLauncherV2Modal.toggle();
|
||||||
|
|||||||
Reference in New Issue
Block a user