From 5886524056f1b431ad453bd919aac0c7785b15e0 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 29 Aug 2026 16:13:54 +0800 Subject: perf(Clip): limit max preview char --- config/General.qml | 4 ++++ popups/launcher/components/Clip.qml | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/General.qml b/config/General.qml index c25c66e..c725b71 100644 --- a/config/General.qml +++ b/config/General.qml @@ -24,4 +24,8 @@ Singleton { readonly property real springAnimationDamping: 0.4 readonly property double accentTransparency: 0.15 + + readonly property int defaultSearchAlgorithm: Searchable.SearchAlgorithm.Include + + readonly property int maxClipPreviewChar: 100 } diff --git a/popups/launcher/components/Clip.qml b/popups/launcher/components/Clip.qml index 38df084..576fabe 100644 --- a/popups/launcher/components/Clip.qml +++ b/popups/launcher/components/Clip.qml @@ -134,7 +134,7 @@ IComponent { Loader { sourceComponent: modelData?.type === "image" ? img : text readonly property Component text: IText { - text: modelData?.data || "" + text: String(modelData?.data || "").substring(0, General.maxClipPreviewChar).replace(/\n/g, " ") color: isSelectedPriority() && index === selectedIndex ? Colors.foreground1 : Colors.foreground2 font.pixelSize: Launcher.widgetFontSize font.bold: isSelectedPriority() && index === selectedIndex @@ -198,6 +198,7 @@ IComponent { Loader { id: loader + asynchronous: true sourceComponent: clipHist[selectedIndex]?.type === "image" ? img : text property Component text: ITextEdit { id: textEdit @@ -211,6 +212,7 @@ IComponent { } property Component img: Image { id: image + asynchronous: true width: preview.width height: preview.height source: clipHist[selectedIndex]?.image || "" @@ -220,6 +222,4 @@ IComponent { } } } - - Component.onCompleted: {} } -- cgit v1.2.3