diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
| commit | f7a43077fe4e139dd7e3f46f448e0951740ec148 (patch) | |
| tree | f6a68248fe42bd899e99049bab7fdb7e5d26ea60 /components/IText.qml | |
| parent | 2f7576faf493b4667b02dcb60ddbf3aa0a9f654b (diff) | |
fix: qmlfmt
IListView: animation
Diffstat (limited to 'components/IText.qml')
| -rw-r--r-- | components/IText.qml | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/components/IText.qml b/components/IText.qml index c3eb817..54878c5 100644 --- a/components/IText.qml +++ b/components/IText.qml @@ -5,66 +5,66 @@ import QtQuick import qs.config Text { - id: root + id: root - property bool animate: false - property real animateFrom: 0 - property real animateTo: 1 - property real multiplier: 1.0 - property real fontSize: Style.font.size.larger + property bool animate: false + property real animateFrom: 0 + property real animateTo: 1 + property real multiplier: 1.0 + property real fontSize: Style.font.size.larger - renderType: Text.NativeRendering // or Text.CurveRendering(much more expansive) or Text.QtRendering for faster - textFormat: Text.PlainText - elide: Text.ElideRight - color: Colors.foreground1 - smooth: true + renderType: Text.NativeRendering // or Text.CurveRendering(much more expansive) or Text.QtRendering for faster + textFormat: Text.PlainText + elide: Text.ElideRight + color: Colors.foreground1 + smooth: true - wrapMode: TextEdit.Wrap + wrapMode: TextEdit.Wrap - font { - family: Style.font.family.iosevka - // pointSize: root.pixelSize - pixelSize: fontSize - } + font { + family: Style.font.family.iosevka + // pointSize: root.pixelSize + pixelSize: fontSize + } - onTextChanged: { - if (animate) { - root.scale = animateFrom; - root.opacity = animateFrom; - scaleAnim.to = animateTo; - opacityAnim.to = animateTo; - scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; - opacityAnim.easing.bezierCurve = Style.anim.curves.standardAccel; - scaleAnim.start(); - opacityAnim.start(); - } - } + onTextChanged: { + if (animate) { + root.scale = animateFrom; + root.opacity = animateFrom; + scaleAnim.to = animateTo; + opacityAnim.to = animateTo; + scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; + opacityAnim.easing.bezierCurve = Style.anim.curves.standardAccel; + scaleAnim.start(); + opacityAnim.start(); + } + } - onLinkActivated: link => { - Qt.openUrlExternally(link); - } + onLinkActivated: link => { + Qt.openUrlExternally(link); + } - Behavior on color { - ColorAnimation { - duration: Style.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Style.anim.curves.standard - } - } + Behavior on color { + ColorAnimation { + duration: Style.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Style.anim.curves.standard + } + } - NumberAnimation { - id: scaleAnim - target: root - property: "scale" - duration: General.animationDuration / 4 / root.multiplier - easing.type: Easing.BezierSpline - } + NumberAnimation { + id: scaleAnim + target: root + property: "scale" + duration: General.animationDuration / 4 / root.multiplier + easing.type: Easing.BezierSpline + } - NumberAnimation { - id: opacityAnim - target: root - property: "opacity" - duration: General.animationDuration / 4 / root.multiplier - easing.type: Easing.BezierSpline - } + NumberAnimation { + id: opacityAnim + target: root + property: "opacity" + duration: General.animationDuration / 4 / root.multiplier + easing.type: Easing.BezierSpline + } } |
