diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 22:40:13 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 22:40:13 +0800 |
| commit | 6487f0a1778efc94f192326c1048f3d05d1b408f (patch) | |
| tree | 17b1a14bb03865fa9437300e458f93b37ab7cbc9 /components/IText.qml | |
| parent | f0b03a1611181b8ff20fc8698bcdb8fa267d23c9 (diff) | |
finish styled top bar
Diffstat (limited to 'components/IText.qml')
| -rw-r--r-- | components/IText.qml | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/components/IText.qml b/components/IText.qml index 1b971c4..bbd9861 100644 --- a/components/IText.qml +++ b/components/IText.qml @@ -1,15 +1,55 @@ +pragma ComponentBehavior: Bound + import QtQuick -import QtQuick.Layouts import qs.config Text { + id: root + + property bool animate: false + property string animateProp: "scale" + property real animateFrom: 0 + property real animateTo: 1 + property int animateDuration: Style.anim.durations.normal + renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter + textFormat: Text.PlainText + color: Colors.foreground + font { - hintingPreference: Font.PreferFullHinting - family: Appearance?.font.family.main ?? "sans-serif" - pixelSize: Appearance?.font.pixelSize.small ?? 15 + family: Style.font.family.iosevka + // pointSize: root.pixelSize + pixelSize: Style.font.size.largerr + } + + Behavior on color { + ColorAnimation { + duration: Style.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Style.anim.curves.standard + } + } + + Behavior on text { + enabled: root.animate + + SequentialAnimation { + Anim { + to: root.animateFrom + easing.bezierCurve: Appearance.anim.curves.standardAccel + } + PropertyAction {} + Anim { + to: root.animateTo + easing.bezierCurve: Appearance.anim.curves.standardDecel + } + } + } + + component Anim: NumberAnimation { + target: root + property: root.animateProp + duration: root.animateDuration / 2 + easing.type: Easing.BezierSpline } - color: Appearance?.m3colors.m3onBackground ?? "black" - linkColor: Appearance?.m3colors.m3primary } |
