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

refactor: (Framemode) Added DeferredAction for dbar/dock state handling

This commit is contained in:
purian23
2026-05-04 10:43:07 -04:00
parent cc47703d48
commit 19c561da14
7 changed files with 245 additions and 84 deletions

View File

@@ -164,7 +164,22 @@ Item {
}
}
property bool barSurfacesLoaded: true
function recreateBarSurfaces() {
if (barSurfacesLoaded)
barSurfacesLoaded = false;
barSurfaceReloadAction.schedule();
}
DeferredAction {
id: barSurfaceReloadAction
onTriggered: root.barSurfacesLoaded = true
}
property string _barLayoutStateJson: {
if (!barSurfacesLoaded)
return "[]";
const configs = SettingsData.barConfigs;
const mapped = configs.map(c => ({
id: c.id,
@@ -188,6 +203,19 @@ Item {
}
}
Connections {
target: SettingsData
function onFrameEnabledChanged() {
root.recreateBarSurfaces();
}
function onConnectedFrameModeActiveChanged() {
root.recreateBarSurfaces();
}
function onForceDankBarLayoutRefresh() {
root.recreateBarSurfaces();
}
}
Frame {}
Repeater {
@@ -203,7 +231,7 @@ Item {
id: barLoader
required property var modelData
property var barConfig: SettingsData.barConfigs.find(cfg => cfg.id === modelData.id) || null
active: barConfig?.enabled ?? false
active: root.barSurfacesLoaded && (barConfig?.enabled ?? false)
asynchronous: false
sourceComponent: DankBar {