internal: fix crash

This commit is contained in:
2 * r + 2 * t 2025-09-12 19:17:35 +10:00
parent 297df9bca1
commit 56f6150ec9

View file

@ -69,7 +69,7 @@ Slider {
function update(): void { function update(): void {
animate = !moving; animate = !moving;
text = moving ? Qt.binding(() => Math.round(root.value * 100)) : Qt.binding(() => root.icon); binding.when = moving;
font.pointSize = moving ? Appearance.font.size.small : Appearance.font.size.larger; font.pointSize = moving ? Appearance.font.size.small : Appearance.font.size.larger;
font.family = moving ? Appearance.font.family.sans : Appearance.font.family.material; font.family = moving ? Appearance.font.family.sans : Appearance.font.family.material;
} }
@ -78,27 +78,36 @@ Slider {
color: Colours.palette.m3inverseOnSurface color: Colours.palette.m3inverseOnSurface
anchors.centerIn: parent anchors.centerIn: parent
Behavior on moving { onMovingChanged: anim.restart()
SequentialAnimation {
Anim { Binding {
target: icon id: binding
property: "scale"
from: 1 target: icon
to: 0 property: "text"
duration: Appearance.anim.durations.normal / 2 value: Math.round(root.value * 100)
easing.bezierCurve: Appearance.anim.curves.standardAccel when: false
} }
ScriptAction {
script: icon.update() SequentialAnimation {
} id: anim
Anim {
target: icon Anim {
property: "scale" target: icon
from: 0 property: "scale"
to: 1 to: 0
duration: Appearance.anim.durations.normal / 2 duration: Appearance.anim.durations.normal / 2
easing.bezierCurve: Appearance.anim.curves.standardDecel easing.bezierCurve: Appearance.anim.curves.standardAccel
} }
ScriptAction {
script: icon.update()
}
Anim {
target: icon
property: "scale"
to: 1
duration: Appearance.anim.durations.normal / 2
easing.bezierCurve: Appearance.anim.curves.standardDecel
} }
} }
} }