diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 15:37:29 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 15:37:29 +1000 |
| commit | a33cd21fc7e6ba0bc20e48b9e5e43cc30d70a015 (patch) | |
| tree | 5700e81c7c74bb765c76053cd31d9b0148b6a2f6 /widgets/StyledText.qml | |
| parent | feat: bar network icon (diff) | |
| download | caelestia-shell-a33cd21fc7e6ba0bc20e48b9e5e43cc30d70a015.tar.gz caelestia-shell-a33cd21fc7e6ba0bc20e48b9e5e43cc30d70a015.tar.bz2 caelestia-shell-a33cd21fc7e6ba0bc20e48b9e5e43cc30d70a015.zip | |
feat: animated text changes
Diffstat (limited to 'widgets/StyledText.qml')
| -rw-r--r-- | widgets/StyledText.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/widgets/StyledText.qml b/widgets/StyledText.qml index ed5d791..6f281de 100644 --- a/widgets/StyledText.qml +++ b/widgets/StyledText.qml @@ -1,9 +1,14 @@ +pragma ComponentBehavior: Bound + import "root:/config" import QtQuick Text { id: root + property bool animate: false + property string animateProp: "opacity" + renderType: Text.NativeRendering color: Appearance.colours.text font.family: Appearance.font.family.sans @@ -15,4 +20,27 @@ Text { easing.bezierCurve: Appearance.anim.curves.standard } } + + Behavior on text { + enabled: root.animate + + SequentialAnimation { + Anim { + to: 0 + easing.bezierCurve: Appearance.anim.curves.standardAccel + } + PropertyAction {} + Anim { + to: 1 + easing.bezierCurve: Appearance.anim.curves.standardDecel + } + } + } + + component Anim: NumberAnimation { + target: root + property: root.animateProp + duration: Appearance.anim.durations.small + easing.type: Easing.BezierSpline + } } |