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
|
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
|
target: root
|
||||||
easing: Tokens.anim.standardDecel
|
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
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue