dashboard crash fix

This commit is contained in:
2026-04-22 13:26:27 +02:00
parent 89ae3b6074
commit 26c2315b66
+48 -48
View File
@@ -38,55 +38,55 @@ Item {
onTriggered: Players.active?.positionChanged() onTriggered: Players.active?.positionChanged()
} }
ServiceRef { // ServiceRef {
service: Audio.cava // service: Audio.cava
} // }
Shape { // Shape {
id: visualizer // id: visualizer
//
readonly property real barW: Math.max(0, (width - gap * (bars - 1)) / bars) // readonly property real barW: Math.max(0, (width - gap * (bars - 1)) / bars)
readonly property int bars: Config.services.visualizerBars // readonly property int bars: Config.services.visualizerBars
property color color: DynamicColors.palette.m3primary // property color color: DynamicColors.palette.m3primary
readonly property real gap: Appearance.spacing.small // readonly property real gap: Appearance.spacing.small
//
anchors.fill: layout // anchors.fill: layout
asynchronous: true // asynchronous: true
data: visualizerBars.instances // data: visualizerBars.instances
preferredRendererType: Shape.CurveRenderer // preferredRendererType: Shape.CurveRenderer
} // }
//
Variants { // Variants {
id: visualizerBars // id: visualizerBars
//
model: Array.from({ // model: Array.from({
length: Config.services.visualizerBars // length: Config.services.visualizerBars
}, (_, i) => i) // }, (_, i) => i)
//
ShapePath { // ShapePath {
id: visualizerBar // id: visualizerBar
//
readonly property real magnitude: value * Config.dashboard.sizes.mediaVisualiserSize // readonly property real magnitude: value * Config.dashboard.sizes.mediaVisualiserSize
required property int modelData // required property int modelData
readonly property real value: Math.max(1e-3, Audio.cava.values[modelData]) // readonly property real value: Math.max(1e-3, Audio.cava.values[modelData])
//
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap // capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
startX: (visualizer.barW / 2) + modelData * (visualizer.barW + visualizer.gap) // startX: (visualizer.barW / 2) + modelData * (visualizer.barW + visualizer.gap)
startY: layout.y + layout.height // startY: layout.y + layout.height
strokeColor: visualizer.color // strokeColor: visualizer.color
strokeWidth: visualizer.barW // strokeWidth: visualizer.barW
//
Behavior on strokeColor { // Behavior on strokeColor {
CAnim { // CAnim {
} // }
} // }
//
PathLine { // PathLine {
relativeX: 0 // relativeX: 0
relativeY: -visualizerBar.magnitude // relativeY: -visualizerBar.magnitude
} // }
} // }
} // }
Shape { Shape {
preferredRendererType: Shape.CurveRenderer preferredRendererType: Shape.CurveRenderer