summaryrefslogtreecommitdiff
path: root/popups
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 /popups
parentea10f143926ec0a66f9cb9dabd392ecbba9228a6 (diff)
perf(Clip): limit max preview char
Diffstat (limited to 'popups')
-rw-r--r--popups/launcher/components/Clip.qml6
1 files changed, 3 insertions, 3 deletions
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: {}
}