summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-08-05 23:17:08 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-08-05 23:17:08 +0800
commit181ef47435bb12180b4d999320dd47a235ba25d3 (patch)
treee9c12b19272402815c6a8cc0e4423bc8e03b7872
parentfe014347317db230d1d6aaaf11e7efe25fe214b6 (diff)
texts: click open links
-rw-r--r--components/IText.qml21
-rw-r--r--components/ITextEdit.qml21
2 files changed, 26 insertions, 16 deletions
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();
- }
- }
}