feat: improve text anim

Force opacity only and use expressive effect curves
This commit is contained in:
2 * r + 2 * t 2026-04-23 00:11:17 +10:00
parent 2126d3f1f2
commit 3191ea9757
2 changed files with 8 additions and 15 deletions

View file

@ -8,10 +8,6 @@ Text {
id: root id: root
property bool animate: false property bool animate: false
property string animateProp: "scale"
property real animateFrom: 0
property real animateTo: 1
property int animateDuration: Tokens.anim.durations.normal
renderType: Text.NativeRendering renderType: Text.NativeRendering
textFormat: Text.PlainText textFormat: Text.PlainText
@ -27,20 +23,18 @@ Text {
SequentialAnimation { SequentialAnimation {
Anim { Anim {
to: root.animateFrom target: root
easing: Tokens.anim.standardAccel property: "opacity"
to: 0
type: Anim.FastEffects
} }
PropertyAction {} PropertyAction {}
Anim { Anim {
to: root.animateTo
easing: Tokens.anim.standardDecel
}
}
}
component Anim: NumberAnimation {
target: root target: root
property: root.animateProp property: "opacity"
duration: root.animateDuration / 2 to: 1
type: Anim.DefaultEffects
}
}
} }
} }

View file

@ -257,7 +257,6 @@ ColumnLayout {
scale: shouldBeVisible && !message.msg ? 1 : 0.7 scale: shouldBeVisible && !message.msg ? 1 : 0.7
opacity: shouldBeVisible && !message.msg ? 1 : 0 opacity: shouldBeVisible && !message.msg ? 1 : 0
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
animateProp: "opacity"
font: Tokens.font.mono.small font: Tokens.font.mono.small
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter