From 181ef47435bb12180b4d999320dd47a235ba25d3 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 5 Aug 2026 23:17:08 +0800 Subject: texts: click open links --- components/IText.qml | 21 +++++++++++++-------- components/ITextEdit.qml | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'components') diff --git a/components/IText.qml b/components/IText.qml index 2b92be4..8510de0 100644 --- a/components/IText.qml +++ b/components/IText.qml @@ -26,6 +26,19 @@ Text { pixelSize: fontSize } + onTextChanged: { + if (animate) { + root.scale = animateFrom; + scaleAnim.to = animateTo; + scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; + scaleAnim.start(); + } + } + + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + Behavior on color { ColorAnimation { duration: Style.anim.durations.normal @@ -42,12 +55,4 @@ Text { easing.type: Easing.BezierSpline } - onTextChanged: { - if (animate) { - root.scale = animateFrom; - scaleAnim.to = animateTo; - scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; - scaleAnim.start(); - } - } } diff --git a/components/ITextEdit.qml b/components/ITextEdit.qml index 91b4a74..f05c8c7 100644 --- a/components/ITextEdit.qml +++ b/components/ITextEdit.qml @@ -25,6 +25,19 @@ TextEdit { pixelSize: fontSize } + onTextChanged: { + if (animate) { + root.scale = animateFrom; + scaleAnim.to = animateTo; + scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; + scaleAnim.start(); + } + } + + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + Behavior on color { ColorAnimation { duration: Style.anim.durations.normal @@ -41,12 +54,4 @@ TextEdit { easing.type: Easing.BezierSpline } - onTextChanged: { - if (animate) { - root.scale = animateFrom; - scaleAnim.to = animateTo; - scaleAnim.easing.bezierCurve = Style.anim.curves.standardAccel; - scaleAnim.start(); - } - } } -- cgit v1.2.3