1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 09:42:10 -04:00

revert popout lazy loaders

This commit is contained in:
bbedward
2025-08-13 18:06:27 -04:00
parent 37b97feeb0
commit 83c97eb245
4 changed files with 69 additions and 178 deletions

View File

@@ -145,13 +145,13 @@ Singleton {
id: matugenCollector id: matugenCollector
onStreamFinished: { onStreamFinished: {
if (!matugenCollector.text) { if (!text) {
ToastService.wallpaperErrorStatus = "error" ToastService.wallpaperErrorStatus = "error"
ToastService.showError("Wallpaper Processing Failed: Empty JSON extracted from matugen output.") ToastService.showError("Wallpaper Processing Failed: Empty JSON extracted from matugen output.")
return return
} }
try { try {
root.matugenColors = JSON.parse(matugenCollector.text) root.matugenColors = JSON.parse(text)
root.colorsUpdated() root.colorsUpdated()
generateAppConfigs() generateAppConfigs()
ToastService.clearWallpaperError() ToastService.clearWallpaperError()

View File

@@ -11,14 +11,8 @@ import qs.Modules.ControlCenter.Network
Item { Item {
id: networkTab id: networkTab
property var wifiPasswordModalRef: { property var wifiPasswordModalRef: wifiPasswordModal
wifiPasswordModalLoader.active = true property var networkInfoModalRef: networkInfoModal
return wifiPasswordModalLoader.item
}
property var networkInfoModalRef: {
networkInfoModalLoader.active = true
return networkInfoModalLoader.item
}
property var sortedWifiNetworks: { property var sortedWifiNetworks: {
if (!NetworkService.wifiAvailable || !NetworkService.wifiEnabled) { if (!NetworkService.wifiAvailable || !NetworkService.wifiEnabled) {

View File

@@ -47,14 +47,6 @@ PanelWindow {
// Configure GPU temperature monitoring based on widget configuration // Configure GPU temperature monitoring based on widget configuration
updateGpuTempConfig() updateGpuTempConfig()
// Activate loaders needed for TopBar components
centcomPopoutLoader.active = true
processListPopoutLoader.active = true
notificationCenterLoader.active = true
batteryPopoutLoader.active = true
controlCenterLoader.active = true
appDrawerLoader.active = true
} }
function updateGpuTempConfig() { function updateGpuTempConfig() {
@@ -597,7 +589,7 @@ PanelWindow {
id: launcherButtonComponent id: launcherButtonComponent
LauncherButton { LauncherButton {
isActive: appDrawerLoader.item ? appDrawerLoader.item.isVisible : false isActive: appDrawerPopout ? appDrawerPopout.isVisible : false
section: { section: {
if (parent && parent.parent) { if (parent && parent.parent) {
if (parent.parent === leftSection) if (parent.parent === leftSection)
@@ -609,12 +601,11 @@ PanelWindow {
} }
return "left" return "left"
} }
popupTarget: appDrawerLoader.item popupTarget: appDrawerPopout
parentScreen: root.screen parentScreen: root.screen
onClicked: { onClicked: {
appDrawerLoader.active = true if (appDrawerPopout)
if (appDrawerLoader.item) appDrawerPopout.toggle()
appDrawerLoader.item.toggle()
} }
} }
} }
@@ -650,13 +641,10 @@ PanelWindow {
return "center" return "center"
return "center" return "center"
} }
popupTarget: centcomPopoutLoader.item popupTarget: centcomPopout
parentScreen: root.screen parentScreen: root.screen
onClockClicked: { onClockClicked: {
centcomPopoutLoader.active = true centcomPopout.calendarVisible = !centcomPopout.calendarVisible
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
}
} }
} }
} }
@@ -675,13 +663,10 @@ PanelWindow {
return "center" return "center"
return "center" return "center"
} }
popupTarget: centcomPopoutLoader.item popupTarget: centcomPopout
parentScreen: root.screen parentScreen: root.screen
onClicked: { onClicked: {
centcomPopoutLoader.active = true centcomPopout.calendarVisible = !centcomPopout.calendarVisible
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
}
} }
} }
} }
@@ -699,13 +684,10 @@ PanelWindow {
return "center" return "center"
return "center" return "center"
} }
popupTarget: centcomPopoutLoader.item popupTarget: centcomPopout
parentScreen: root.screen parentScreen: root.screen
onClicked: { onClicked: {
centcomPopoutLoader.active = true centcomPopout.calendarVisible = !centcomPopout.calendarVisible
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
}
} }
} }
} }
@@ -749,12 +731,10 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: processListPopoutLoader.item popupTarget: processListPopout
parentScreen: root.screen parentScreen: root.screen
toggleProcessList: () => { toggleProcessList: () => {
processListPopoutLoader.active = true return processListPopout.toggle()
if (processListPopoutLoader.item)
return processListPopoutLoader.item.toggle()
} }
} }
} }
@@ -772,12 +752,10 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: processListPopoutLoader.item popupTarget: processListPopout
parentScreen: root.screen parentScreen: root.screen
toggleProcessList: () => { toggleProcessList: () => {
processListPopoutLoader.active = true return processListPopout.toggle()
if (processListPopoutLoader.item)
return processListPopoutLoader.item.toggle()
} }
} }
} }
@@ -795,12 +773,10 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: processListPopoutLoader.item popupTarget: processListPopout
parentScreen: root.screen parentScreen: root.screen
toggleProcessList: () => { toggleProcessList: () => {
processListPopoutLoader.active = true return processListPopout.toggle()
if (processListPopoutLoader.item)
return processListPopoutLoader.item.toggle()
} }
} }
} }
@@ -818,13 +794,11 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: processListPopoutLoader.item popupTarget: processListPopout
parentScreen: root.screen parentScreen: root.screen
widgetData: parent.widgetData widgetData: parent.widgetData
toggleProcessList: () => { toggleProcessList: () => {
processListPopoutLoader.active = true return processListPopout.toggle()
if (processListPopoutLoader.item)
return processListPopoutLoader.item.toggle()
} }
} }
} }
@@ -834,7 +808,7 @@ PanelWindow {
NotificationCenterButton { NotificationCenterButton {
hasUnread: root.notificationCount > 0 hasUnread: root.notificationCount > 0
isActive: notificationCenterLoader.item ? notificationCenterLoader.item.notificationHistoryVisible : false isActive: notificationCenter.notificationHistoryVisible
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -844,14 +818,11 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: notificationCenterLoader.item popupTarget: notificationCenter
parentScreen: root.screen parentScreen: root.screen
onClicked: { onClicked: {
notificationCenterLoader.active = true notificationCenter.notificationHistoryVisible
if (notificationCenterLoader.item) { = !notificationCenter.notificationHistoryVisible
notificationCenterLoader.item.notificationHistoryVisible
= !notificationCenterLoader.item.notificationHistoryVisible
}
} }
} }
} }
@@ -860,7 +831,7 @@ PanelWindow {
id: batteryComponent id: batteryComponent
Battery { Battery {
batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.batteryPopupVisible : false batteryPopupVisible: batteryPopout.batteryPopupVisible
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -870,13 +841,10 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: batteryPopoutLoader.item popupTarget: batteryPopout
parentScreen: root.screen parentScreen: root.screen
onToggleBatteryPopup: { onToggleBatteryPopup: {
batteryPopoutLoader.active = true batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible
if (batteryPopoutLoader.item) {
batteryPopoutLoader.item.batteryPopupVisible = !batteryPopoutLoader.item.batteryPopupVisible
}
} }
} }
} }
@@ -885,7 +853,7 @@ PanelWindow {
id: controlCenterButtonComponent id: controlCenterButtonComponent
ControlCenterButton { ControlCenterButton {
isActive: controlCenterLoader.item ? controlCenterLoader.item.controlCenterVisible : false isActive: controlCenterPopout.controlCenterVisible
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -895,21 +863,18 @@ PanelWindow {
return "center" return "center"
return "right" return "right"
} }
popupTarget: controlCenterLoader.item popupTarget: controlCenterPopout
parentScreen: root.screen parentScreen: root.screen
onClicked: { onClicked: {
controlCenterLoader.active = true controlCenterPopout.triggerScreen = root.screen
if (controlCenterLoader.item) { controlCenterPopout.controlCenterVisible = !controlCenterPopout.controlCenterVisible
controlCenterLoader.item.triggerScreen = root.screen if (controlCenterPopout.controlCenterVisible) {
controlCenterLoader.item.controlCenterVisible = !controlCenterLoader.item.controlCenterVisible
if (controlCenterLoader.item.controlCenterVisible) {
if (NetworkService.wifiEnabled) if (NetworkService.wifiEnabled)
NetworkService.scanWifi() NetworkService.scanWifi()
} }
} }
} }
} }
}
Component { Component {
id: spacerComponent id: spacerComponent

View File

@@ -42,51 +42,26 @@ ShellRoot {
delegate: Dock { delegate: Dock {
modelData: item modelData: item
contextMenu: dockContextMenuLoader.item ? dockContextMenuLoader.item : null contextMenu: dockContextMenu
windowsMenu: dockWindowsMenuLoader.item ? dockWindowsMenuLoader.item : null windowsMenu: dockWindowsMenu
Component.onCompleted: {
dockContextMenuLoader.active = true
dockWindowsMenuLoader.active = true
} }
} }
}
LazyLoader {
id: centcomPopoutLoader
active: false
CentcomPopout { CentcomPopout {
id: centcomPopout id: centcomPopout
} }
}
LazyLoader {
id: dockContextMenuLoader
active: false
DockContextMenu { DockContextMenu {
id: dockContextMenu id: dockContextMenu
} }
}
LazyLoader {
id: dockWindowsMenuLoader
active: false
DockWindowsMenu { DockWindowsMenu {
id: dockWindowsMenu id: dockWindowsMenu
} }
}
LazyLoader {
id: notificationCenterLoader
active: false
NotificationCenterPopout { NotificationCenterPopout {
id: notificationCenter id: notificationCenter
} }
}
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
@@ -96,94 +71,51 @@ ShellRoot {
} }
} }
LazyLoader {
id: controlCenterLoader
active: false
ControlCenterPopout { ControlCenterPopout {
id: controlCenterPopout id: controlCenterPopout
onPowerActionRequested: (action, title, message) => { onPowerActionRequested: (action, title, message) => {
powerConfirmModalLoader.active = true powerConfirmModal.powerConfirmAction = action
if (powerConfirmModalLoader.item) { powerConfirmModal.powerConfirmTitle = title
powerConfirmModalLoader.item.powerConfirmAction = action powerConfirmModal.powerConfirmMessage = message
powerConfirmModalLoader.item.powerConfirmTitle = title powerConfirmModal.powerConfirmVisible = true
powerConfirmModalLoader.item.powerConfirmMessage = message
powerConfirmModalLoader.item.powerConfirmVisible = true
}
} }
onLockRequested: { onLockRequested: {
lock.activate() lock.activate()
} }
} }
}
LazyLoader {
id: wifiPasswordModalLoader
active: false
WifiPasswordModal { WifiPasswordModal {
id: wifiPasswordModal id: wifiPasswordModal
} }
}
LazyLoader {
id: networkInfoModalLoader
active: false
NetworkInfoModal { NetworkInfoModal {
id: networkInfoModal id: networkInfoModal
} }
}
LazyLoader {
id: batteryPopoutLoader
active: false
BatteryPopout { BatteryPopout {
id: batteryPopout id: batteryPopout
} }
}
LazyLoader {
id: powerMenuLoader
active: false
PowerMenu { PowerMenu {
id: powerMenu id: powerMenu
} }
}
LazyLoader {
id: powerConfirmModalLoader
active: false
PowerConfirmModal { PowerConfirmModal {
id: powerConfirmModal id: powerConfirmModal
} }
}
LazyLoader {
id: processListPopoutLoader
active: false
ProcessListPopout { ProcessListPopout {
id: processListPopout id: processListPopout
} }
}
SettingsModal { SettingsModal {
id: settingsModal id: settingsModal
} }
LazyLoader {
id: appDrawerLoader
active: false
AppDrawerPopout { AppDrawerPopout {
id: appDrawerPopout id: appDrawerPopout
} }
}
SpotlightModal { SpotlightModal {
id: spotlightModal id: spotlightModal