fix: dash media lyrics overlapping

Apparently Behavior on model is a bad idea...
This commit is contained in:
2 * r + 2 * t 2026-05-08 02:49:28 +10:00
parent 8107627737
commit ba2d4f03d6

View file

@ -25,6 +25,7 @@ Item {
readonly property real fadeAmount: 0.1 readonly property real fadeAmount: 0.1
property bool flag property bool flag
property list<string> lyricList: Lyrics.lyrics
layer.enabled: true layer.enabled: true
layer.effect: Mask { layer.effect: Mask {
@ -236,7 +237,7 @@ Item {
displayMarginBeginning: anchors.topMargin displayMarginBeginning: anchors.topMargin
displayMarginEnd: anchors.bottomMargin displayMarginEnd: anchors.bottomMargin
model: Lyrics.lyrics model: root.lyricList
Component.onCompleted: { Component.onCompleted: {
currentIndex = Qt.binding(() => { currentIndex = Qt.binding(() => {
model; // Force update when lyrics change model; // Force update when lyrics change
@ -285,28 +286,28 @@ Item {
} }
} }
Behavior on model {
SequentialAnimation {
Anim {
target: lyrics
property: "opacity"
to: 0
type: Anim.DefaultEffects
}
PropertyAction {}
Anim {
target: lyrics
property: "opacity"
to: 1
type: Anim.SlowEffects
}
}
}
Behavior on opacity { Behavior on opacity {
Anim { Anim {
type: Anim.SlowEffects type: Anim.SlowEffects
} }
} }
} }
Behavior on lyricList {
SequentialAnimation {
Anim {
target: lyrics
property: "opacity"
to: 0
type: Anim.DefaultEffects
}
PropertyAction {}
Anim {
target: lyrics
property: "opacity"
to: 1
type: Anim.SlowEffects
}
}
}
} }