diff --git a/quickshell/DMSShell.qml b/quickshell/DMSShell.qml index f1614b44..feab1aab 100644 --- a/quickshell/DMSShell.qml +++ b/quickshell/DMSShell.qml @@ -271,6 +271,7 @@ Item { sourceComponent: Component { DankDashPopout { id: dankDashPopout + onPopoutClosed: PopoutService.unloadDankDash() } } } @@ -290,8 +291,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.notificationCenterLoader = notificationCenterLoader; + } + NotificationCenterPopout { id: notificationCenter + onPopoutClosed: PopoutService.unloadNotificationCenter() Component.onCompleted: { PopoutService.notificationCenterPopout = notificationCenter; @@ -315,10 +321,15 @@ Item { property var modalRef: colorPickerModal property LazyLoader powerModalLoaderRef: powerMenuModalLoader + Component.onCompleted: { + PopoutService.controlCenterLoader = controlCenterLoader; + } + ControlCenterPopout { id: controlCenterPopout colorPickerModal: controlCenterLoader.modalRef powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef + onPopoutClosed: PopoutService.unloadControlCenter() onLockRequested: { lock.activate(); @@ -426,8 +437,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.batteryPopoutLoader = batteryPopoutLoader; + } + BatteryPopout { id: batteryPopout + onPopoutClosed: PopoutService.unloadBattery() Component.onCompleted: { PopoutService.batteryPopout = batteryPopout; @@ -440,8 +456,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.layoutPopoutLoader = layoutPopoutLoader; + } + DWLLayoutPopout { id: layoutPopout + onPopoutClosed: PopoutService.unloadLayoutPopout() Component.onCompleted: { PopoutService.layoutPopout = layoutPopout; @@ -454,8 +475,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.vpnPopoutLoader = vpnPopoutLoader; + } + VpnPopout { id: vpnPopout + onPopoutClosed: PopoutService.unloadVpn() Component.onCompleted: { PopoutService.vpnPopout = vpnPopout; @@ -468,8 +494,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.processListPopoutLoader = processListPopoutLoader; + } + ProcessListPopout { id: processListPopout + onPopoutClosed: PopoutService.unloadProcessListPopout() Component.onCompleted: { PopoutService.processListPopout = processListPopout; @@ -512,8 +543,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.appDrawerLoader = appDrawerLoader; + } + AppDrawerPopout { id: appDrawerPopout + onPopoutClosed: PopoutService.unloadAppDrawer() Component.onCompleted: { PopoutService.appDrawerPopout = appDrawerPopout; @@ -545,8 +581,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.clipboardHistoryPopoutLoader = clipboardHistoryPopoutLoader; + } + ClipboardHistoryPopout { id: clipboardHistoryPopout + onPopoutClosed: PopoutService.unloadClipboardHistoryPopout() Component.onCompleted: { PopoutService.clipboardHistoryPopout = clipboardHistoryPopout; @@ -721,8 +762,13 @@ Item { active: false + Component.onCompleted: { + PopoutService.systemUpdateLoader = systemUpdateLoader; + } + SystemUpdatePopout { id: systemUpdatePopout + onPopoutClosed: PopoutService.unloadSystemUpdate() Component.onCompleted: { PopoutService.systemUpdatePopout = systemUpdatePopout; diff --git a/quickshell/Modules/DankBar/DankBarContent.qml b/quickshell/Modules/DankBar/DankBarContent.qml index 08f8fec5..fb0db4d9 100644 --- a/quickshell/Modules/DankBar/DankBarContent.qml +++ b/quickshell/Modules/DankBar/DankBarContent.qml @@ -561,10 +561,7 @@ Item { axis: barWindow.axis section: topBarContent.getWidgetSection(parent) parentScreen: barWindow.screen - popoutTarget: { - clipboardHistoryPopoutLoader.active = true; - return clipboardHistoryPopoutLoader.item; - } + popoutTarget: clipboardHistoryPopoutLoader.item ?? null function openClipboardPopout(initialTab) { clipboardHistoryPopoutLoader.active = true; @@ -759,10 +756,7 @@ Item { barThickness: barWindow.effectiveBarThickness widgetThickness: barWindow.widgetThickness section: topBarContent.getWidgetSection(parent) || "center" - popoutTarget: { - dankDashPopoutLoader.active = true; - return dankDashPopoutLoader.item; - } + popoutTarget: dankDashPopoutLoader.item ?? null parentScreen: barWindow.screen Component.onCompleted: { @@ -826,10 +820,7 @@ Item { barThickness: barWindow.effectiveBarThickness widgetThickness: barWindow.widgetThickness section: topBarContent.getWidgetSection(parent) || "center" - popoutTarget: { - dankDashPopoutLoader.active = true; - return dankDashPopoutLoader.item; - } + popoutTarget: dankDashPopoutLoader.item ?? null parentScreen: barWindow.screen onClicked: { dankDashPopoutLoader.active = true; @@ -881,10 +872,7 @@ Item { barThickness: barWindow.effectiveBarThickness widgetThickness: barWindow.widgetThickness section: topBarContent.getWidgetSection(parent) || "center" - popoutTarget: { - dankDashPopoutLoader.active = true; - return dankDashPopoutLoader.item; - } + popoutTarget: dankDashPopoutLoader.item ?? null parentScreen: barWindow.screen onClicked: { dankDashPopoutLoader.active = true; @@ -968,10 +956,7 @@ Item { widgetThickness: barWindow.widgetThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - processListPopoutLoader.active = true; - return processListPopoutLoader.item; - } + popoutTarget: processListPopoutLoader.item ?? null parentScreen: barWindow.screen widgetData: parent.widgetData onCpuClicked: { @@ -1004,10 +989,7 @@ Item { widgetThickness: barWindow.widgetThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - processListPopoutLoader.active = true; - return processListPopoutLoader.item; - } + popoutTarget: processListPopoutLoader.item ?? null parentScreen: barWindow.screen widgetData: parent.widgetData onRamClicked: { @@ -1054,10 +1036,7 @@ Item { widgetThickness: barWindow.widgetThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - processListPopoutLoader.active = true; - return processListPopoutLoader.item; - } + popoutTarget: processListPopoutLoader.item ?? null parentScreen: barWindow.screen widgetData: parent.widgetData onCpuTempClicked: { @@ -1090,10 +1069,7 @@ Item { widgetThickness: barWindow.widgetThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - processListPopoutLoader.active = true; - return processListPopoutLoader.item; - } + popoutTarget: processListPopoutLoader.item ?? null parentScreen: barWindow.screen widgetData: parent.widgetData onGpuTempClicked: { @@ -1134,10 +1110,7 @@ Item { barThickness: barWindow.effectiveBarThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - notificationCenterLoader.active = true; - return notificationCenterLoader.item; - } + popoutTarget: notificationCenterLoader.item ?? null parentScreen: barWindow.screen onClicked: { notificationCenterLoader.active = true; @@ -1172,10 +1145,7 @@ Item { section: topBarContent.getWidgetSection(parent) || "right" barSpacing: barConfig?.spacing ?? 4 barConfig: topBarContent.barConfig - popoutTarget: { - batteryPopoutLoader.active = true; - return batteryPopoutLoader.item; - } + popoutTarget: batteryPopoutLoader.item ?? null parentScreen: barWindow.screen onToggleBatteryPopup: { batteryPopoutLoader.active = true; @@ -1208,10 +1178,7 @@ Item { barThickness: barWindow.effectiveBarThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "center" - popoutTarget: { - layoutPopoutLoader.active = true; - return layoutPopoutLoader.item; - } + popoutTarget: layoutPopoutLoader.item ?? null parentScreen: barWindow.screen onToggleLayoutPopup: { layoutPopoutLoader.active = true; @@ -1244,10 +1211,7 @@ Item { barSpacing: barConfig?.spacing ?? 4 barConfig: topBarContent.barConfig isAutoHideBar: topBarContent.barConfig?.autoHide ?? false - popoutTarget: { - vpnPopoutLoader.active = true; - return vpnPopoutLoader.item; - } + popoutTarget: vpnPopoutLoader.item ?? null parentScreen: barWindow.screen onToggleVpnPopup: { vpnPopoutLoader.active = true; @@ -1281,10 +1245,7 @@ Item { barThickness: barWindow.effectiveBarThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - controlCenterLoader.active = true; - return controlCenterLoader.item; - } + popoutTarget: controlCenterLoader.item ?? null parentScreen: barWindow.screen screenName: barWindow.screen?.name || "" screenModel: barWindow.screen?.model || "" @@ -1434,10 +1395,7 @@ Item { barThickness: barWindow.effectiveBarThickness axis: barWindow.axis section: topBarContent.getWidgetSection(parent) || "right" - popoutTarget: { - systemUpdateLoader.active = true; - return systemUpdateLoader.item; - } + popoutTarget: systemUpdateLoader.item ?? null parentScreen: barWindow.screen onClicked: { systemUpdateLoader.active = true; diff --git a/quickshell/Services/PopoutService.qml b/quickshell/Services/PopoutService.qml index d14522a1..69d26cad 100644 --- a/quickshell/Services/PopoutService.qml +++ b/quickshell/Services/PopoutService.qml @@ -9,19 +9,29 @@ Singleton { id: root property var controlCenterPopout: null + property var controlCenterLoader: null property var notificationCenterPopout: null + property var notificationCenterLoader: null property var appDrawerPopout: null + property var appDrawerLoader: null property var processListPopout: null + property var processListPopoutLoader: null property var dankDashPopout: null property var dankDashPopoutLoader: null property var batteryPopout: null + property var batteryPopoutLoader: null property var vpnPopout: null + property var vpnPopoutLoader: 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 settingsModalLoader: null property var clipboardHistoryModal: null - property var clipboardHistoryPopout: null property var dankLauncherV2Modal: null property var dankLauncherV2ModalLoader: null property var powerMenuModal: null @@ -59,6 +69,13 @@ Singleton { controlCenterPopout?.close(); } + function unloadControlCenter() { + if (!controlCenterLoader) + return; + controlCenterPopout = null; + controlCenterLoader.active = false; + } + function toggleControlCenter(x, y, width, section, screen) { if (controlCenterPopout) { setPosition(controlCenterPopout, x, y, width, section, screen); @@ -77,6 +94,13 @@ Singleton { notificationCenterPopout?.close(); } + function unloadNotificationCenter() { + if (!notificationCenterLoader) + return; + notificationCenterPopout = null; + notificationCenterLoader.active = false; + } + function toggleNotificationCenter(x, y, width, section, screen) { if (notificationCenterPopout) { setPosition(notificationCenterPopout, x, y, width, section, screen); @@ -95,6 +119,13 @@ Singleton { appDrawerPopout?.close(); } + function unloadAppDrawer() { + if (!appDrawerLoader) + return; + appDrawerPopout = null; + appDrawerLoader.active = false; + } + function toggleAppDrawer(x, y, width, section, screen) { if (appDrawerPopout) { setPosition(appDrawerPopout, x, y, width, section, screen); @@ -113,6 +144,13 @@ Singleton { processListPopout?.close(); } + function unloadProcessListPopout() { + if (!processListPopoutLoader) + return; + processListPopout = null; + processListPopoutLoader.active = false; + } + function toggleProcessList(x, y, width, section, screen) { if (processListPopout) { setPosition(processListPopout, x, y, width, section, screen); @@ -161,6 +199,13 @@ Singleton { dankDashPopout.dashVisible = false; } + function unloadDankDash() { + if (!dankDashPopoutLoader) + return; + dankDashPopout = null; + dankDashPopoutLoader.active = false; + } + function toggleDankDash(tabIndex, x, y, width, section, screen) { _dankDashPendingTab = tabIndex || 0; if (dankDashPopout) { @@ -217,6 +262,13 @@ Singleton { batteryPopout?.close(); } + function unloadBattery() { + if (!batteryPopoutLoader) + return; + batteryPopout = null; + batteryPopoutLoader.active = false; + } + function toggleBattery(x, y, width, section, screen) { if (batteryPopout) { setPosition(batteryPopout, x, y, width, section, screen); @@ -235,6 +287,13 @@ Singleton { vpnPopout?.close(); } + function unloadVpn() { + if (!vpnPopoutLoader) + return; + vpnPopout = null; + vpnPopoutLoader.active = false; + } + function toggleVpn(x, y, width, section, screen) { if (vpnPopout) { setPosition(vpnPopout, x, y, width, section, screen); @@ -253,6 +312,13 @@ Singleton { systemUpdatePopout?.close(); } + function unloadSystemUpdate() { + if (!systemUpdateLoader) + return; + systemUpdatePopout = null; + systemUpdateLoader.active = false; + } + function toggleSystemUpdate(x, y, width, section, screen) { if (systemUpdatePopout) { setPosition(systemUpdatePopout, x, y, width, section, screen); @@ -413,6 +479,20 @@ Singleton { 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 _dankLauncherV2WantsToggle: false property string _dankLauncherV2PendingQuery: ""