From 56f6150ec92fb6d07ee72394ffdb37dc5ccc7b26 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 12 Sep 2025 19:17:35 +1000 Subject: internal: fix crash --- components/controls/FilledSlider.qml | 53 +++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'components') diff --git a/components/controls/FilledSlider.qml b/components/controls/FilledSlider.qml index f095a7d..4bf721a 100644 --- a/components/controls/FilledSlider.qml +++ b/components/controls/FilledSlider.qml @@ -69,7 +69,7 @@ Slider { function update(): void { 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.family = moving ? Appearance.font.family.sans : Appearance.font.family.material; } @@ -78,27 +78,36 @@ Slider { color: Colours.palette.m3inverseOnSurface anchors.centerIn: parent - Behavior on moving { - SequentialAnimation { - Anim { - target: icon - property: "scale" - from: 1 - to: 0 - duration: Appearance.anim.durations.normal / 2 - easing.bezierCurve: Appearance.anim.curves.standardAccel - } - ScriptAction { - script: icon.update() - } - Anim { - target: icon - property: "scale" - from: 0 - to: 1 - duration: Appearance.anim.durations.normal / 2 - easing.bezierCurve: Appearance.anim.curves.standardDecel - } + onMovingChanged: anim.restart() + + Binding { + id: binding + + target: icon + property: "text" + value: Math.round(root.value * 100) + when: false + } + + SequentialAnimation { + id: anim + + Anim { + target: icon + property: "scale" + to: 0 + duration: Appearance.anim.durations.normal / 2 + 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 } } } -- cgit v1.2.3-freya