1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05: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,17 +863,14 @@ 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 (NetworkService.wifiEnabled)
if (controlCenterLoader.item.controlCenterVisible) { NetworkService.scanWifi()
if (NetworkService.wifiEnabled)
NetworkService.scanWifi()
}
} }
} }
} }

134
shell.qml
View File

@@ -42,50 +42,25 @@ 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 { CentcomPopout {
id: centcomPopoutLoader id: centcomPopout
active: false
CentcomPopout {
id: centcomPopout
}
} }
LazyLoader { DockContextMenu {
id: dockContextMenuLoader id: dockContextMenu
active: false
DockContextMenu {
id: dockContextMenu
}
} }
LazyLoader { DockWindowsMenu {
id: dockWindowsMenuLoader id: dockWindowsMenu
active: false
DockWindowsMenu {
id: dockWindowsMenu
}
} }
LazyLoader { NotificationCenterPopout {
id: notificationCenterLoader id: notificationCenter
active: false
NotificationCenterPopout {
id: notificationCenter
}
} }
Variants { Variants {
@@ -96,93 +71,50 @@ ShellRoot {
} }
} }
LazyLoader { ControlCenterPopout {
id: controlCenterLoader id: controlCenterPopout
active: false
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 { WifiPasswordModal {
id: wifiPasswordModalLoader id: wifiPasswordModal
active: false
WifiPasswordModal {
id: wifiPasswordModal
}
} }
LazyLoader { NetworkInfoModal {
id: networkInfoModalLoader id: networkInfoModal
active: false
NetworkInfoModal {
id: networkInfoModal
}
} }
LazyLoader { BatteryPopout {
id: batteryPopoutLoader id: batteryPopout
active: false
BatteryPopout {
id: batteryPopout
}
} }
LazyLoader { PowerMenu {
id: powerMenuLoader id: powerMenu
active: false
PowerMenu {
id: powerMenu
}
} }
LazyLoader { PowerConfirmModal {
id: powerConfirmModalLoader id: powerConfirmModal
active: false
PowerConfirmModal {
id: powerConfirmModal
}
} }
LazyLoader { ProcessListPopout {
id: processListPopoutLoader id: processListPopout
active: false
ProcessListPopout {
id: processListPopout
}
} }
SettingsModal { SettingsModal {
id: settingsModal id: settingsModal
} }
LazyLoader { AppDrawerPopout {
id: appDrawerLoader id: appDrawerPopout
active: false
AppDrawerPopout {
id: appDrawerPopout
}
} }
SpotlightModal { SpotlightModal {