mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 21:45:38 -05:00
bring back lazy loaders
This commit is contained in:
@@ -145,13 +145,13 @@ Singleton {
|
||||
id: matugenCollector
|
||||
|
||||
onStreamFinished: {
|
||||
if (!text) {
|
||||
if (!matugenCollector.text) {
|
||||
ToastService.wallpaperErrorStatus = "error"
|
||||
ToastService.showError("Wallpaper Processing Failed: Empty JSON extracted from matugen output.")
|
||||
return
|
||||
}
|
||||
try {
|
||||
root.matugenColors = JSON.parse(text)
|
||||
root.matugenColors = JSON.parse(matugenCollector.text)
|
||||
root.colorsUpdated()
|
||||
generateAppConfigs()
|
||||
ToastService.clearWallpaperError()
|
||||
|
||||
@@ -11,8 +11,14 @@ import qs.Modules.ControlCenter.Network
|
||||
Item {
|
||||
id: networkTab
|
||||
|
||||
property var wifiPasswordModalRef: wifiPasswordModal
|
||||
property var networkInfoModalRef: networkInfoModal
|
||||
property var wifiPasswordModalRef: {
|
||||
wifiPasswordModalLoader.active = true
|
||||
return wifiPasswordModalLoader.item
|
||||
}
|
||||
property var networkInfoModalRef: {
|
||||
networkInfoModalLoader.active = true
|
||||
return networkInfoModalLoader.item
|
||||
}
|
||||
|
||||
property var sortedWifiNetworks: {
|
||||
if (!NetworkService.wifiAvailable || !NetworkService.wifiEnabled) {
|
||||
|
||||
@@ -589,7 +589,7 @@ PanelWindow {
|
||||
id: launcherButtonComponent
|
||||
|
||||
LauncherButton {
|
||||
isActive: appDrawerPopout ? appDrawerPopout.isVisible : false
|
||||
isActive: appDrawerLoader.item ? appDrawerLoader.item.isVisible : false
|
||||
section: {
|
||||
if (parent && parent.parent) {
|
||||
if (parent.parent === leftSection)
|
||||
@@ -601,11 +601,12 @@ PanelWindow {
|
||||
}
|
||||
return "left"
|
||||
}
|
||||
popupTarget: appDrawerPopout
|
||||
popupTarget: appDrawerLoader.item
|
||||
parentScreen: root.screen
|
||||
onClicked: {
|
||||
if (appDrawerPopout)
|
||||
appDrawerPopout.toggle()
|
||||
appDrawerLoader.active = true
|
||||
if (appDrawerLoader.item)
|
||||
appDrawerLoader.item.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -641,10 +642,16 @@ if (appDrawerPopout)
|
||||
return "center"
|
||||
return "center"
|
||||
}
|
||||
popupTarget: centcomPopout
|
||||
popupTarget: {
|
||||
centcomPopoutLoader.active = true
|
||||
return centcomPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onClockClicked: {
|
||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
centcomPopoutLoader.active = true
|
||||
if (centcomPopoutLoader.item) {
|
||||
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -663,10 +670,16 @@ centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
return "center"
|
||||
return "center"
|
||||
}
|
||||
popupTarget: centcomPopout
|
||||
popupTarget: {
|
||||
centcomPopoutLoader.active = true
|
||||
return centcomPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onClicked: {
|
||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
centcomPopoutLoader.active = true
|
||||
if (centcomPopoutLoader.item) {
|
||||
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -684,10 +697,16 @@ centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
return "center"
|
||||
return "center"
|
||||
}
|
||||
popupTarget: centcomPopout
|
||||
popupTarget: {
|
||||
centcomPopoutLoader.active = true
|
||||
return centcomPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onClicked: {
|
||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
centcomPopoutLoader.active = true
|
||||
if (centcomPopoutLoader.item) {
|
||||
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -731,10 +750,15 @@ centcomPopout.calendarVisible = !centcomPopout.calendarVisible
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: processListPopout
|
||||
popupTarget: {
|
||||
processListPopoutLoader.active = true
|
||||
return processListPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
toggleProcessList: () => {
|
||||
return processListPopout.toggle()
|
||||
processListPopoutLoader.active = true
|
||||
if (processListPopoutLoader.item)
|
||||
return processListPopoutLoader.item.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -752,10 +776,15 @@ return processListPopout.toggle()
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: processListPopout
|
||||
popupTarget: {
|
||||
processListPopoutLoader.active = true
|
||||
return processListPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
toggleProcessList: () => {
|
||||
return processListPopout.toggle()
|
||||
processListPopoutLoader.active = true
|
||||
if (processListPopoutLoader.item)
|
||||
return processListPopoutLoader.item.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,10 +802,15 @@ return processListPopout.toggle()
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: processListPopout
|
||||
popupTarget: {
|
||||
processListPopoutLoader.active = true
|
||||
return processListPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
toggleProcessList: () => {
|
||||
return processListPopout.toggle()
|
||||
processListPopoutLoader.active = true
|
||||
if (processListPopoutLoader.item)
|
||||
return processListPopoutLoader.item.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -794,11 +828,16 @@ return processListPopout.toggle()
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: processListPopout
|
||||
popupTarget: {
|
||||
processListPopoutLoader.active = true
|
||||
return processListPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
widgetData: parent.widgetData
|
||||
toggleProcessList: () => {
|
||||
return processListPopout.toggle()
|
||||
processListPopoutLoader.active = true
|
||||
if (processListPopoutLoader.item)
|
||||
return processListPopoutLoader.item.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -808,7 +847,7 @@ return processListPopout.toggle()
|
||||
|
||||
NotificationCenterButton {
|
||||
hasUnread: root.notificationCount > 0
|
||||
isActive: notificationCenter.notificationHistoryVisible
|
||||
isActive: notificationCenterLoader.item ? notificationCenterLoader.item.notificationHistoryVisible : false
|
||||
section: {
|
||||
if (parent && parent.parent === leftSection)
|
||||
return "left"
|
||||
@@ -818,11 +857,17 @@ return processListPopout.toggle()
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: notificationCenter
|
||||
popupTarget: {
|
||||
notificationCenterLoader.active = true
|
||||
return notificationCenterLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onClicked: {
|
||||
notificationCenter.notificationHistoryVisible
|
||||
= !notificationCenter.notificationHistoryVisible
|
||||
notificationCenterLoader.active = true
|
||||
if (notificationCenterLoader.item) {
|
||||
notificationCenterLoader.item.notificationHistoryVisible
|
||||
= !notificationCenterLoader.item.notificationHistoryVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -831,7 +876,7 @@ notificationCenter.notificationHistoryVisible
|
||||
id: batteryComponent
|
||||
|
||||
Battery {
|
||||
batteryPopupVisible: batteryPopout.batteryPopupVisible
|
||||
batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.batteryPopupVisible : false
|
||||
section: {
|
||||
if (parent && parent.parent === leftSection)
|
||||
return "left"
|
||||
@@ -841,10 +886,16 @@ notificationCenter.notificationHistoryVisible
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: batteryPopout
|
||||
popupTarget: {
|
||||
batteryPopoutLoader.active = true
|
||||
return batteryPopoutLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onToggleBatteryPopup: {
|
||||
batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible
|
||||
batteryPopoutLoader.active = true
|
||||
if (batteryPopoutLoader.item) {
|
||||
batteryPopoutLoader.item.batteryPopupVisible = !batteryPopoutLoader.item.batteryPopupVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -853,7 +904,7 @@ batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible
|
||||
id: controlCenterButtonComponent
|
||||
|
||||
ControlCenterButton {
|
||||
isActive: controlCenterPopout.controlCenterVisible
|
||||
isActive: controlCenterLoader.item ? controlCenterLoader.item.controlCenterVisible : false
|
||||
section: {
|
||||
if (parent && parent.parent === leftSection)
|
||||
return "left"
|
||||
@@ -863,14 +914,20 @@ batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible
|
||||
return "center"
|
||||
return "right"
|
||||
}
|
||||
popupTarget: controlCenterPopout
|
||||
popupTarget: {
|
||||
controlCenterLoader.active = true
|
||||
return controlCenterLoader.item
|
||||
}
|
||||
parentScreen: root.screen
|
||||
onClicked: {
|
||||
controlCenterPopout.triggerScreen = root.screen
|
||||
controlCenterPopout.controlCenterVisible = !controlCenterPopout.controlCenterVisible
|
||||
if (controlCenterPopout.controlCenterVisible) {
|
||||
if (NetworkService.wifiEnabled)
|
||||
NetworkService.scanWifi()
|
||||
controlCenterLoader.active = true
|
||||
if (controlCenterLoader.item) {
|
||||
controlCenterLoader.item.triggerScreen = root.screen
|
||||
controlCenterLoader.item.controlCenterVisible = !controlCenterLoader.item.controlCenterVisible
|
||||
if (controlCenterLoader.item.controlCenterVisible) {
|
||||
if (NetworkService.wifiEnabled)
|
||||
NetworkService.scanWifi()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
134
shell.qml
134
shell.qml
@@ -42,25 +42,50 @@ ShellRoot {
|
||||
|
||||
delegate: Dock {
|
||||
modelData: item
|
||||
contextMenu: dockContextMenu
|
||||
windowsMenu: dockWindowsMenu
|
||||
contextMenu: dockContextMenuLoader.item ? dockContextMenuLoader.item : null
|
||||
windowsMenu: dockWindowsMenuLoader.item ? dockWindowsMenuLoader.item : null
|
||||
|
||||
Component.onCompleted: {
|
||||
dockContextMenuLoader.active = true
|
||||
dockWindowsMenuLoader.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CentcomPopout {
|
||||
id: centcomPopout
|
||||
LazyLoader {
|
||||
id: centcomPopoutLoader
|
||||
active: false
|
||||
|
||||
CentcomPopout {
|
||||
id: centcomPopout
|
||||
}
|
||||
}
|
||||
|
||||
DockContextMenu {
|
||||
id: dockContextMenu
|
||||
LazyLoader {
|
||||
id: dockContextMenuLoader
|
||||
active: false
|
||||
|
||||
DockContextMenu {
|
||||
id: dockContextMenu
|
||||
}
|
||||
}
|
||||
|
||||
DockWindowsMenu {
|
||||
id: dockWindowsMenu
|
||||
LazyLoader {
|
||||
id: dockWindowsMenuLoader
|
||||
active: false
|
||||
|
||||
DockWindowsMenu {
|
||||
id: dockWindowsMenu
|
||||
}
|
||||
}
|
||||
|
||||
NotificationCenterPopout {
|
||||
id: notificationCenter
|
||||
LazyLoader {
|
||||
id: notificationCenterLoader
|
||||
active: false
|
||||
|
||||
NotificationCenterPopout {
|
||||
id: notificationCenter
|
||||
}
|
||||
}
|
||||
|
||||
Variants {
|
||||
@@ -71,50 +96,93 @@ ShellRoot {
|
||||
}
|
||||
}
|
||||
|
||||
ControlCenterPopout {
|
||||
id: controlCenterPopout
|
||||
LazyLoader {
|
||||
id: controlCenterLoader
|
||||
active: false
|
||||
|
||||
onPowerActionRequested: (action, title, message) => {
|
||||
powerConfirmModal.powerConfirmAction = action
|
||||
powerConfirmModal.powerConfirmTitle = title
|
||||
powerConfirmModal.powerConfirmMessage = message
|
||||
powerConfirmModal.powerConfirmVisible = true
|
||||
ControlCenterPopout {
|
||||
id: controlCenterPopout
|
||||
|
||||
onPowerActionRequested: (action, title, message) => {
|
||||
powerConfirmModalLoader.active = true
|
||||
if (powerConfirmModalLoader.item) {
|
||||
powerConfirmModalLoader.item.powerConfirmAction = action
|
||||
powerConfirmModalLoader.item.powerConfirmTitle = title
|
||||
powerConfirmModalLoader.item.powerConfirmMessage = message
|
||||
powerConfirmModalLoader.item.powerConfirmVisible = true
|
||||
}
|
||||
}
|
||||
onLockRequested: {
|
||||
lock.activate()
|
||||
onLockRequested: {
|
||||
lock.activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WifiPasswordModal {
|
||||
id: wifiPasswordModal
|
||||
LazyLoader {
|
||||
id: wifiPasswordModalLoader
|
||||
active: false
|
||||
|
||||
WifiPasswordModal {
|
||||
id: wifiPasswordModal
|
||||
}
|
||||
}
|
||||
|
||||
NetworkInfoModal {
|
||||
id: networkInfoModal
|
||||
LazyLoader {
|
||||
id: networkInfoModalLoader
|
||||
active: false
|
||||
|
||||
NetworkInfoModal {
|
||||
id: networkInfoModal
|
||||
}
|
||||
}
|
||||
|
||||
BatteryPopout {
|
||||
id: batteryPopout
|
||||
LazyLoader {
|
||||
id: batteryPopoutLoader
|
||||
active: false
|
||||
|
||||
BatteryPopout {
|
||||
id: batteryPopout
|
||||
}
|
||||
}
|
||||
|
||||
PowerMenu {
|
||||
id: powerMenu
|
||||
LazyLoader {
|
||||
id: powerMenuLoader
|
||||
active: false
|
||||
|
||||
PowerMenu {
|
||||
id: powerMenu
|
||||
}
|
||||
}
|
||||
|
||||
PowerConfirmModal {
|
||||
id: powerConfirmModal
|
||||
LazyLoader {
|
||||
id: powerConfirmModalLoader
|
||||
active: false
|
||||
|
||||
PowerConfirmModal {
|
||||
id: powerConfirmModal
|
||||
}
|
||||
}
|
||||
|
||||
ProcessListPopout {
|
||||
id: processListPopout
|
||||
LazyLoader {
|
||||
id: processListPopoutLoader
|
||||
active: false
|
||||
|
||||
ProcessListPopout {
|
||||
id: processListPopout
|
||||
}
|
||||
}
|
||||
|
||||
SettingsModal {
|
||||
id: settingsModal
|
||||
}
|
||||
|
||||
AppDrawerPopout {
|
||||
id: appDrawerPopout
|
||||
LazyLoader {
|
||||
id: appDrawerLoader
|
||||
active: false
|
||||
|
||||
AppDrawerPopout {
|
||||
id: appDrawerPopout
|
||||
}
|
||||
}
|
||||
|
||||
SpotlightModal {
|
||||
|
||||
Reference in New Issue
Block a user