diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-17 12:55:36 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-18 00:44:22 +0800 |
| commit | f23ced82012a9f85739210aa333cd6f92815c50a (patch) | |
| tree | 45542ee259ff0377aa2cf37ebedfa252dbfc80cf | |
| parent | 7b4076be7e305bacf8c55d75589e841c29d250e1 (diff) | |
fix(Clip): image support
| -rw-r--r-- | launcher/components/Clip.qml | 12 | ||||
| -rw-r--r-- | services/Clip.qml | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/launcher/components/Clip.qml b/launcher/components/Clip.qml index 29b5959..c342d44 100644 --- a/launcher/components/Clip.qml +++ b/launcher/components/Clip.qml @@ -100,9 +100,15 @@ IComponent { } Column { - IText { - text: modelData?.data || "" - font.pixelSize: Style.font.size.largerr + Loader { + sourceComponent: modelData?.isImage ? img : text + readonly property Component text: IText { + text: modelData?.data || "" + font.pixelSize: Style.font.size.largerr + } + readonly property Component img: Image { + source: modelData?.data || "" + } } Row { spacing: Launcher.innerMargin diff --git a/services/Clip.qml b/services/Clip.qml index bd662ca..5feb1fb 100644 --- a/services/Clip.qml +++ b/services/Clip.qml @@ -45,10 +45,9 @@ Searchable { } } - const idStr = idNum >= 0 ? "" + idNum : ""; - const imgPath = idStr ? imgMap[idStr] || "" : ""; + const imgPath = idNum >= 0 ? imgMap[idNum] || "" : ""; const isImg = !!imgPath; - const metadata = _clipMetadata[idStr] || {}; + const metadata = _clipMetadata[idNum] || {}; return { index: idNum, @@ -58,7 +57,9 @@ Searchable { timestamp: metadata.timestamp || "", appId: metadata.appId || "", appTitle: metadata.appTitle || "", - appIcon: Quickshell.iconPath(AppSearch.guessIcon(metadata.appId), "image-missing") + appIcon: Quickshell.iconPath(AppSearch.guessIcon(metadata.appId), "image-missing"), + image: imgPath, + decoded: root._clipDecoded[idx] || "" }; }); } |
