Time drawer animations by their direction, so closing speeds apply
The duration was picked from `open`, which can update after the progress animation has already started, so closes ran at the opening speed. Use the Behavior's target value instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b03bd77941
commit
604424869d
1 file changed
+6
-2
@@ -50,13 +50,17 @@ Item {
|
||||
// Content parent, for items reparented in at runtime.
|
||||
readonly property alias container: inner
|
||||
// Enter: emphasized decelerate; exit: emphasized accelerate (Material 3).
|
||||
// Timing follows where the animation is heading, not `open`: both bindings
|
||||
// depend on `open`, and the animation can start before the duration updates.
|
||||
Behavior on progress {
|
||||
id: motionBehavior
|
||||
NumberAnimation {
|
||||
id: anim
|
||||
duration: root.liquid ? (root.open ? Theme.notchPanelOpenDuration : Theme.notchPanelCloseDuration) : root.open ? root.openDuration : root.closeDuration
|
||||
readonly property bool opening: motionBehavior.targetValue > 0.5
|
||||
duration: root.liquid ? (anim.opening ? Theme.notchPanelOpenDuration : Theme.notchPanelCloseDuration) : anim.opening ? root.openDuration : root.closeDuration
|
||||
// NotchDrop eases each phase itself.
|
||||
easing.type: root.liquid ? Easing.Linear : Easing.BezierSpline
|
||||
easing.bezierCurve: root.open ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
|
||||
easing.bezierCurve: anim.opening ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
|
||||
}
|
||||
}
|
||||
implicitWidth: contentWidth + 2 * ear
|
||||
|
||||
Reference in new issue
Block a user