fix: don't loader variants

Change model instead
This may or may not help with the background not loading
This commit is contained in:
2 * r + 2 * t 2026-04-06 23:04:48 +10:00
parent ffa7d88cae
commit 612f828b9f

View file

@ -7,159 +7,154 @@ import qs.components.containers
import qs.services import qs.services
import qs.config import qs.config
Loader { Variants {
asynchronous: true model: Config.background.enabled ? Screens.screens : []
active: Config.background.enabled
sourceComponent: Variants { StyledWindow {
model: Screens.screens id: win
StyledWindow { required property ShellScreen modelData
id: win
required property ShellScreen modelData screen: modelData
name: "background"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
color: Config.background.wallpaperEnabled ? "black" : "transparent"
surfaceFormat.opaque: false
screen: modelData anchors.top: true
name: "background" anchors.bottom: true
WlrLayershell.exclusionMode: ExclusionMode.Ignore anchors.left: true
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom anchors.right: true
color: Config.background.wallpaperEnabled ? "black" : "transparent"
surfaceFormat.opaque: false
anchors.top: true Item {
anchors.bottom: true id: behindClock
anchors.left: true
anchors.right: true
Item { anchors.fill: parent
id: behindClock
Loader {
id: wallpaper
asynchronous: true
anchors.fill: parent anchors.fill: parent
active: Config.background.wallpaperEnabled
Loader { sourceComponent: Wallpaper {}
id: wallpaper }
asynchronous: true Visualiser {
anchors.fill: parent
screen: win.modelData
wallpaper: wallpaper
}
}
anchors.fill: parent Loader {
active: Config.background.wallpaperEnabled id: clockLoader
sourceComponent: Wallpaper {} asynchronous: true
active: Config.background.desktopClock.enabled
anchors.margins: Appearance.padding.large * 2
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
state: Config.background.desktopClock.position
states: [
State {
name: "top-left"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.left: parent.left
}
},
State {
name: "top-center"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "top-right"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.right: parent.right
}
},
State {
name: "middle-left"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
}
},
State {
name: "middle-center"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "middle-right"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
}
},
State {
name: "bottom-left"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.left: parent.left
}
},
State {
name: "bottom-center"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "bottom-right"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.right: parent.right
}
} }
]
Visualiser { transitions: Transition {
anchors.fill: parent AnchorAnimation {
screen: win.modelData duration: Appearance.anim.durations.expressiveDefaultSpatial
wallpaper: wallpaper easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
} }
} }
Loader { sourceComponent: DesktopClock {
id: clockLoader wallpaper: behindClock
absX: clockLoader.x
asynchronous: true absY: clockLoader.y
active: Config.background.desktopClock.enabled
anchors.margins: Appearance.padding.large * 2
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
state: Config.background.desktopClock.position
states: [
State {
name: "top-left"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.left: parent.left
}
},
State {
name: "top-center"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "top-right"
AnchorChanges {
target: clockLoader
anchors.top: parent.top
anchors.right: parent.right
}
},
State {
name: "middle-left"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
}
},
State {
name: "middle-center"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "middle-right"
AnchorChanges {
target: clockLoader
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
}
},
State {
name: "bottom-left"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.left: parent.left
}
},
State {
name: "bottom-center"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
},
State {
name: "bottom-right"
AnchorChanges {
target: clockLoader
anchors.bottom: parent.bottom
anchors.right: parent.right
}
}
]
transitions: Transition {
AnchorAnimation {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
}
}
sourceComponent: DesktopClock {
wallpaper: behindClock
absX: clockLoader.x
absY: clockLoader.y
}
} }
} }
} }