summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-08-29 16:13:54 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-08-29 16:13:54 +0800
commit5886524056f1b431ad453bd919aac0c7785b15e0 (patch)
tree447a7e9f66528e2e14653fed1d8d59aa6ef9a05f
parentea10f143926ec0a66f9cb9dabd392ecbba9228a6 (diff)
perf(Clip): limit max preview char
-rw-r--r--config/General.qml4
-rw-r--r--popups/launcher/components/Clip.qml6
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: {}
}