mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
bar: fix bar order-creation regression caused by async loading
port 1.5
This commit is contained in:
@@ -116,12 +116,28 @@ Item {
|
|||||||
|
|
||||||
property var hyprlandOverviewLoaderRef: hyprlandOverviewLoader
|
property var hyprlandOverviewLoaderRef: hyprlandOverviewLoader
|
||||||
|
|
||||||
|
// Horizontal bars must claim their exclusive zones first, so vertical bars wait for every enabled horizontal bar to load
|
||||||
|
readonly property int horizontalWanted: SettingsData.barConfigs.filter(c => (c.enabled ?? false) && c.position !== SettingsData.Position.Left && c.position !== SettingsData.Position.Right).length
|
||||||
|
property int horizontalReady: 0
|
||||||
|
|
||||||
|
function recountHorizontalReady() {
|
||||||
|
let ready = 0;
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
const loader = itemAt(i);
|
||||||
|
if (loader?.item && !loader.isVertical)
|
||||||
|
ready++;
|
||||||
|
}
|
||||||
|
horizontalReady = ready;
|
||||||
|
}
|
||||||
|
|
||||||
delegate: Loader {
|
delegate: Loader {
|
||||||
id: barLoader
|
id: barLoader
|
||||||
required property var modelData
|
required property var modelData
|
||||||
property var barConfig: SettingsData.barConfigs.find(cfg => cfg.id === modelData.id) || null
|
property var barConfig: SettingsData.barConfigs.find(cfg => cfg.id === modelData.id) || null
|
||||||
active: root.barSurfacesLoaded && (barConfig?.enabled ?? false)
|
readonly property bool isVertical: modelData.position === SettingsData.Position.Left || modelData.position === SettingsData.Position.Right
|
||||||
|
active: root.barSurfacesLoaded && (barConfig?.enabled ?? false) && (!isVertical || dankBarRepeater.horizontalReady >= dankBarRepeater.horizontalWanted)
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
|
onItemChanged: dankBarRepeater.recountHorizontalReady()
|
||||||
|
|
||||||
sourceComponent: DankBar {
|
sourceComponent: DankBar {
|
||||||
barConfig: barLoader.barConfig
|
barConfig: barLoader.barConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user