From 4f69a5086f201fadddf5e8eb82e58134e43d34c1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 14 Aug 2025 15:18:11 +0800 Subject: perf(IText): more performant rendering type --- bar/TimeDate.qml | 4 +++- components/IText.qml | 2 +- launcher/components/App.qml | 1 + launcher/components/Clip.qml | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bar/TimeDate.qml b/bar/TimeDate.qml index 8e554ef..2716e6d 100644 --- a/bar/TimeDate.qml +++ b/bar/TimeDate.qml @@ -58,6 +58,7 @@ Item { } IText { text: ":" + renderType: Text.CurveRendering } IText { animate: true @@ -65,11 +66,12 @@ Item { } IText { text: ":" + renderType: Text.CurveRendering } IText { animate: true text: (root.s >= 10 ? "" : "0") + root.s - renderType: Text.CurveRendering // it's not static and is rapidly updated + renderType: Text.QtRendering // it's not static and is rapidly updated } } Item { diff --git a/components/IText.qml b/components/IText.qml index b6a01b0..c528dc2 100644 --- a/components/IText.qml +++ b/components/IText.qml @@ -11,7 +11,7 @@ Text { property real animateFrom: 0 property real animateTo: 1 - renderType: Text.NativeRendering // or Text.CurveRenderer + renderType: Text.NativeRendering // or Text.CurveRendering(much more expansive) or Text.QtRendering for faster textFormat: Text.PlainText elide: Text.ElideRight color: Colors.foreground1 diff --git a/launcher/components/App.qml b/launcher/components/App.qml index 0ed16a3..8e0c61d 100644 --- a/launcher/components/App.qml +++ b/launcher/components/App.qml @@ -154,6 +154,7 @@ IComponent { } IText { text: modelData.name + renderType: Text.QtRendering } } diff --git a/launcher/components/Clip.qml b/launcher/components/Clip.qml index 789cd48..e9584e2 100644 --- a/launcher/components/Clip.qml +++ b/launcher/components/Clip.qml @@ -103,9 +103,11 @@ IComponent { IText { text: modelData?.isImage ? "Image" : "Text" || "" + renderType: Text.QtRendering } IText { text: modelData?.data || "" + renderType: Text.QtRendering } } -- cgit v1.2.3