feat: improve text anim
Force opacity only and use expressive effect curves
This commit is contained in:
parent
2126d3f1f2
commit
3191ea9757
2 changed files with 8 additions and 15 deletions
|
|
@ -8,10 +8,6 @@ Text {
|
|||
id: root
|
||||
|
||||
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
|
||||
textFormat: Text.PlainText
|
||||
|
|
@ -27,20 +23,18 @@ Text {
|
|||
|
||||
SequentialAnimation {
|
||||
Anim {
|
||||
to: root.animateFrom
|
||||
easing: Tokens.anim.standardAccel
|
||||
target: root
|
||||
property: "opacity"
|
||||
to: 0
|
||||
type: Anim.FastEffects
|
||||
}
|
||||
PropertyAction {}
|
||||
Anim {
|
||||
to: root.animateTo
|
||||
easing: Tokens.anim.standardDecel
|
||||
target: root
|
||||
property: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
target: root
|
||||
property: root.animateProp
|
||||
duration: root.animateDuration / 2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,6 @@ ColumnLayout {
|
|||
scale: shouldBeVisible && !message.msg ? 1 : 0.7
|
||||
opacity: shouldBeVisible && !message.msg ? 1 : 0
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
animateProp: "opacity"
|
||||
|
||||
font: Tokens.font.mono.small
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue