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

popout: fully unload popout layers on close

This commit is contained in:
bbedward
2026-02-24 15:19:30 -05:00
parent 2f04be8778
commit da47b573be
3 changed files with 141 additions and 57 deletions

View File

@@ -271,6 +271,7 @@ Item {
sourceComponent: Component { sourceComponent: Component {
DankDashPopout { DankDashPopout {
id: dankDashPopout id: dankDashPopout
onPopoutClosed: PopoutService.unloadDankDash()
} }
} }
} }
@@ -290,8 +291,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.notificationCenterLoader = notificationCenterLoader;
}
NotificationCenterPopout { NotificationCenterPopout {
id: notificationCenter id: notificationCenter
onPopoutClosed: PopoutService.unloadNotificationCenter()
Component.onCompleted: { Component.onCompleted: {
PopoutService.notificationCenterPopout = notificationCenter; PopoutService.notificationCenterPopout = notificationCenter;
@@ -315,10 +321,15 @@ Item {
property var modalRef: colorPickerModal property var modalRef: colorPickerModal
property LazyLoader powerModalLoaderRef: powerMenuModalLoader property LazyLoader powerModalLoaderRef: powerMenuModalLoader
Component.onCompleted: {
PopoutService.controlCenterLoader = controlCenterLoader;
}
ControlCenterPopout { ControlCenterPopout {
id: controlCenterPopout id: controlCenterPopout
colorPickerModal: controlCenterLoader.modalRef colorPickerModal: controlCenterLoader.modalRef
powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef
onPopoutClosed: PopoutService.unloadControlCenter()
onLockRequested: { onLockRequested: {
lock.activate(); lock.activate();
@@ -443,8 +454,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.batteryPopoutLoader = batteryPopoutLoader;
}
BatteryPopout { BatteryPopout {
id: batteryPopout id: batteryPopout
onPopoutClosed: PopoutService.unloadBattery()
Component.onCompleted: { Component.onCompleted: {
PopoutService.batteryPopout = batteryPopout; PopoutService.batteryPopout = batteryPopout;
@@ -457,8 +473,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.layoutPopoutLoader = layoutPopoutLoader;
}
DWLLayoutPopout { DWLLayoutPopout {
id: layoutPopout id: layoutPopout
onPopoutClosed: PopoutService.unloadLayoutPopout()
Component.onCompleted: { Component.onCompleted: {
PopoutService.layoutPopout = layoutPopout; PopoutService.layoutPopout = layoutPopout;
@@ -471,8 +492,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.vpnPopoutLoader = vpnPopoutLoader;
}
VpnPopout { VpnPopout {
id: vpnPopout id: vpnPopout
onPopoutClosed: PopoutService.unloadVpn()
Component.onCompleted: { Component.onCompleted: {
PopoutService.vpnPopout = vpnPopout; PopoutService.vpnPopout = vpnPopout;
@@ -485,8 +511,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.processListPopoutLoader = processListPopoutLoader;
}
ProcessListPopout { ProcessListPopout {
id: processListPopout id: processListPopout
onPopoutClosed: PopoutService.unloadProcessListPopout()
Component.onCompleted: { Component.onCompleted: {
PopoutService.processListPopout = processListPopout; PopoutService.processListPopout = processListPopout;
@@ -529,8 +560,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.appDrawerLoader = appDrawerLoader;
}
AppDrawerPopout { AppDrawerPopout {
id: appDrawerPopout id: appDrawerPopout
onPopoutClosed: PopoutService.unloadAppDrawer()
Component.onCompleted: { Component.onCompleted: {
PopoutService.appDrawerPopout = appDrawerPopout; PopoutService.appDrawerPopout = appDrawerPopout;
@@ -562,8 +598,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.clipboardHistoryPopoutLoader = clipboardHistoryPopoutLoader;
}
ClipboardHistoryPopout { ClipboardHistoryPopout {
id: clipboardHistoryPopout id: clipboardHistoryPopout
onPopoutClosed: PopoutService.unloadClipboardHistoryPopout()
Component.onCompleted: { Component.onCompleted: {
PopoutService.clipboardHistoryPopout = clipboardHistoryPopout; PopoutService.clipboardHistoryPopout = clipboardHistoryPopout;
@@ -738,8 +779,13 @@ Item {
active: false active: false
Component.onCompleted: {
PopoutService.systemUpdateLoader = systemUpdateLoader;
}
SystemUpdatePopout { SystemUpdatePopout {
id: systemUpdatePopout id: systemUpdatePopout
onPopoutClosed: PopoutService.unloadSystemUpdate()
Component.onCompleted: { Component.onCompleted: {
PopoutService.systemUpdatePopout = systemUpdatePopout; PopoutService.systemUpdatePopout = systemUpdatePopout;

View File

@@ -561,10 +561,7 @@ Item {
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) section: topBarContent.getWidgetSection(parent)
parentScreen: barWindow.screen parentScreen: barWindow.screen
popoutTarget: { popoutTarget: clipboardHistoryPopoutLoader.item ?? null
clipboardHistoryPopoutLoader.active = true;
return clipboardHistoryPopoutLoader.item;
}
function openClipboardPopout(initialTab) { function openClipboardPopout(initialTab) {
clipboardHistoryPopoutLoader.active = true; clipboardHistoryPopoutLoader.active = true;
@@ -759,10 +756,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
section: topBarContent.getWidgetSection(parent) || "center" section: topBarContent.getWidgetSection(parent) || "center"
popoutTarget: { popoutTarget: dankDashPopoutLoader.item ?? null
dankDashPopoutLoader.active = true;
return dankDashPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
Component.onCompleted: { Component.onCompleted: {
@@ -826,10 +820,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
section: topBarContent.getWidgetSection(parent) || "center" section: topBarContent.getWidgetSection(parent) || "center"
popoutTarget: { popoutTarget: dankDashPopoutLoader.item ?? null
dankDashPopoutLoader.active = true;
return dankDashPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onClicked: { onClicked: {
dankDashPopoutLoader.active = true; dankDashPopoutLoader.active = true;
@@ -881,10 +872,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
section: topBarContent.getWidgetSection(parent) || "center" section: topBarContent.getWidgetSection(parent) || "center"
popoutTarget: { popoutTarget: dankDashPopoutLoader.item ?? null
dankDashPopoutLoader.active = true;
return dankDashPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onClicked: { onClicked: {
dankDashPopoutLoader.active = true; dankDashPopoutLoader.active = true;
@@ -968,10 +956,7 @@ Item {
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: processListPopoutLoader.item ?? null
processListPopoutLoader.active = true;
return processListPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
widgetData: parent.widgetData widgetData: parent.widgetData
onCpuClicked: { onCpuClicked: {
@@ -1004,10 +989,7 @@ Item {
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: processListPopoutLoader.item ?? null
processListPopoutLoader.active = true;
return processListPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
widgetData: parent.widgetData widgetData: parent.widgetData
onRamClicked: { onRamClicked: {
@@ -1054,10 +1036,7 @@ Item {
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: processListPopoutLoader.item ?? null
processListPopoutLoader.active = true;
return processListPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
widgetData: parent.widgetData widgetData: parent.widgetData
onCpuTempClicked: { onCpuTempClicked: {
@@ -1090,10 +1069,7 @@ Item {
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: processListPopoutLoader.item ?? null
processListPopoutLoader.active = true;
return processListPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
widgetData: parent.widgetData widgetData: parent.widgetData
onGpuTempClicked: { onGpuTempClicked: {
@@ -1134,10 +1110,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: notificationCenterLoader.item ?? null
notificationCenterLoader.active = true;
return notificationCenterLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onClicked: { onClicked: {
notificationCenterLoader.active = true; notificationCenterLoader.active = true;
@@ -1172,10 +1145,7 @@ Item {
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
barSpacing: barConfig?.spacing ?? 4 barSpacing: barConfig?.spacing ?? 4
barConfig: topBarContent.barConfig barConfig: topBarContent.barConfig
popoutTarget: { popoutTarget: batteryPopoutLoader.item ?? null
batteryPopoutLoader.active = true;
return batteryPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onToggleBatteryPopup: { onToggleBatteryPopup: {
batteryPopoutLoader.active = true; batteryPopoutLoader.active = true;
@@ -1208,10 +1178,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "center" section: topBarContent.getWidgetSection(parent) || "center"
popoutTarget: { popoutTarget: layoutPopoutLoader.item ?? null
layoutPopoutLoader.active = true;
return layoutPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onToggleLayoutPopup: { onToggleLayoutPopup: {
layoutPopoutLoader.active = true; layoutPopoutLoader.active = true;
@@ -1244,10 +1211,7 @@ Item {
barSpacing: barConfig?.spacing ?? 4 barSpacing: barConfig?.spacing ?? 4
barConfig: topBarContent.barConfig barConfig: topBarContent.barConfig
isAutoHideBar: topBarContent.barConfig?.autoHide ?? false isAutoHideBar: topBarContent.barConfig?.autoHide ?? false
popoutTarget: { popoutTarget: vpnPopoutLoader.item ?? null
vpnPopoutLoader.active = true;
return vpnPopoutLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onToggleVpnPopup: { onToggleVpnPopup: {
vpnPopoutLoader.active = true; vpnPopoutLoader.active = true;
@@ -1281,10 +1245,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: controlCenterLoader.item ?? null
controlCenterLoader.active = true;
return controlCenterLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
screenName: barWindow.screen?.name || "" screenName: barWindow.screen?.name || ""
screenModel: barWindow.screen?.model || "" screenModel: barWindow.screen?.model || ""
@@ -1434,10 +1395,7 @@ Item {
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
axis: barWindow.axis axis: barWindow.axis
section: topBarContent.getWidgetSection(parent) || "right" section: topBarContent.getWidgetSection(parent) || "right"
popoutTarget: { popoutTarget: systemUpdateLoader.item ?? null
systemUpdateLoader.active = true;
return systemUpdateLoader.item;
}
parentScreen: barWindow.screen parentScreen: barWindow.screen
onClicked: { onClicked: {
systemUpdateLoader.active = true; systemUpdateLoader.active = true;

View File

@@ -9,19 +9,29 @@ Singleton {
id: root id: root
property var controlCenterPopout: null property var controlCenterPopout: null
property var controlCenterLoader: null
property var notificationCenterPopout: null property var notificationCenterPopout: null
property var notificationCenterLoader: null
property var appDrawerPopout: null property var appDrawerPopout: null
property var appDrawerLoader: null
property var processListPopout: null property var processListPopout: null
property var processListPopoutLoader: null
property var dankDashPopout: null property var dankDashPopout: null
property var dankDashPopoutLoader: null property var dankDashPopoutLoader: null
property var batteryPopout: null property var batteryPopout: null
property var batteryPopoutLoader: null
property var vpnPopout: null property var vpnPopout: null
property var vpnPopoutLoader: null
property var systemUpdatePopout: null property var systemUpdatePopout: null
property var systemUpdateLoader: null
property var layoutPopout: null
property var layoutPopoutLoader: null
property var clipboardHistoryPopout: null
property var clipboardHistoryPopoutLoader: null
property var settingsModal: null property var settingsModal: null
property var settingsModalLoader: null property var settingsModalLoader: null
property var clipboardHistoryModal: null property var clipboardHistoryModal: null
property var clipboardHistoryPopout: null
property var dankLauncherV2Modal: null property var dankLauncherV2Modal: null
property var dankLauncherV2ModalLoader: null property var dankLauncherV2ModalLoader: null
property var powerMenuModal: null property var powerMenuModal: null
@@ -61,6 +71,13 @@ Singleton {
controlCenterPopout?.close(); controlCenterPopout?.close();
} }
function unloadControlCenter() {
if (!controlCenterLoader)
return;
controlCenterPopout = null;
controlCenterLoader.active = false;
}
function toggleControlCenter(x, y, width, section, screen) { function toggleControlCenter(x, y, width, section, screen) {
if (controlCenterPopout) { if (controlCenterPopout) {
setPosition(controlCenterPopout, x, y, width, section, screen); setPosition(controlCenterPopout, x, y, width, section, screen);
@@ -79,6 +96,13 @@ Singleton {
notificationCenterPopout?.close(); notificationCenterPopout?.close();
} }
function unloadNotificationCenter() {
if (!notificationCenterLoader)
return;
notificationCenterPopout = null;
notificationCenterLoader.active = false;
}
function toggleNotificationCenter(x, y, width, section, screen) { function toggleNotificationCenter(x, y, width, section, screen) {
if (notificationCenterPopout) { if (notificationCenterPopout) {
setPosition(notificationCenterPopout, x, y, width, section, screen); setPosition(notificationCenterPopout, x, y, width, section, screen);
@@ -97,6 +121,13 @@ Singleton {
appDrawerPopout?.close(); appDrawerPopout?.close();
} }
function unloadAppDrawer() {
if (!appDrawerLoader)
return;
appDrawerPopout = null;
appDrawerLoader.active = false;
}
function toggleAppDrawer(x, y, width, section, screen) { function toggleAppDrawer(x, y, width, section, screen) {
if (appDrawerPopout) { if (appDrawerPopout) {
setPosition(appDrawerPopout, x, y, width, section, screen); setPosition(appDrawerPopout, x, y, width, section, screen);
@@ -115,6 +146,13 @@ Singleton {
processListPopout?.close(); processListPopout?.close();
} }
function unloadProcessListPopout() {
if (!processListPopoutLoader)
return;
processListPopout = null;
processListPopoutLoader.active = false;
}
function toggleProcessList(x, y, width, section, screen) { function toggleProcessList(x, y, width, section, screen) {
if (processListPopout) { if (processListPopout) {
setPosition(processListPopout, x, y, width, section, screen); setPosition(processListPopout, x, y, width, section, screen);
@@ -163,6 +201,13 @@ Singleton {
dankDashPopout.dashVisible = false; dankDashPopout.dashVisible = false;
} }
function unloadDankDash() {
if (!dankDashPopoutLoader)
return;
dankDashPopout = null;
dankDashPopoutLoader.active = false;
}
function toggleDankDash(tabIndex, x, y, width, section, screen) { function toggleDankDash(tabIndex, x, y, width, section, screen) {
_dankDashPendingTab = tabIndex || 0; _dankDashPendingTab = tabIndex || 0;
if (dankDashPopout) { if (dankDashPopout) {
@@ -219,6 +264,13 @@ Singleton {
batteryPopout?.close(); batteryPopout?.close();
} }
function unloadBattery() {
if (!batteryPopoutLoader)
return;
batteryPopout = null;
batteryPopoutLoader.active = false;
}
function toggleBattery(x, y, width, section, screen) { function toggleBattery(x, y, width, section, screen) {
if (batteryPopout) { if (batteryPopout) {
setPosition(batteryPopout, x, y, width, section, screen); setPosition(batteryPopout, x, y, width, section, screen);
@@ -237,6 +289,13 @@ Singleton {
vpnPopout?.close(); vpnPopout?.close();
} }
function unloadVpn() {
if (!vpnPopoutLoader)
return;
vpnPopout = null;
vpnPopoutLoader.active = false;
}
function toggleVpn(x, y, width, section, screen) { function toggleVpn(x, y, width, section, screen) {
if (vpnPopout) { if (vpnPopout) {
setPosition(vpnPopout, x, y, width, section, screen); setPosition(vpnPopout, x, y, width, section, screen);
@@ -255,6 +314,13 @@ Singleton {
systemUpdatePopout?.close(); systemUpdatePopout?.close();
} }
function unloadSystemUpdate() {
if (!systemUpdateLoader)
return;
systemUpdatePopout = null;
systemUpdateLoader.active = false;
}
function toggleSystemUpdate(x, y, width, section, screen) { function toggleSystemUpdate(x, y, width, section, screen) {
if (systemUpdatePopout) { if (systemUpdatePopout) {
setPosition(systemUpdatePopout, x, y, width, section, screen); setPosition(systemUpdatePopout, x, y, width, section, screen);
@@ -415,6 +481,20 @@ Singleton {
clipboardHistoryModal?.close(); clipboardHistoryModal?.close();
} }
function unloadClipboardHistoryPopout() {
if (!clipboardHistoryPopoutLoader)
return;
clipboardHistoryPopout = null;
clipboardHistoryPopoutLoader.active = false;
}
function unloadLayoutPopout() {
if (!layoutPopoutLoader)
return;
layoutPopout = null;
layoutPopoutLoader.active = false;
}
property bool _dankLauncherV2WantsOpen: false property bool _dankLauncherV2WantsOpen: false
property bool _dankLauncherV2WantsToggle: false property bool _dankLauncherV2WantsToggle: false
property string _dankLauncherV2PendingQuery: "" property string _dankLauncherV2PendingQuery: ""