diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-26 20:40:40 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-26 20:40:40 +1000 |
| commit | 838eb74eb83a0491004fab93d1721d63e4f2a225 (patch) | |
| tree | d1216d5a92eeb32eb9a1bf26c7ad32013bba991f /components/images/CachingImage.qml | |
| parent | plugin: add saveItem (diff) | |
| download | caelestia-shell-838eb74eb83a0491004fab93d1721d63e4f2a225.tar.gz caelestia-shell-838eb74eb83a0491004fab93d1721d63e4f2a225.tar.bz2 caelestia-shell-838eb74eb83a0491004fab93d1721d63e4f2a225.zip | |
internal: async save item
Fixes #180
Diffstat (limited to 'components/images/CachingImage.qml')
| -rw-r--r-- | components/images/CachingImage.qml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/images/CachingImage.qml b/components/images/CachingImage.qml index 01411a1..75c9126 100644 --- a/components/images/CachingImage.qml +++ b/components/images/CachingImage.qml @@ -1,4 +1,5 @@ import qs.utils +import Caelestia import Quickshell import Quickshell.Io import QtQuick @@ -8,7 +9,7 @@ Image { property string path property string hash - readonly property string cachePath: `${Paths.stringify(Paths.imagecache)}/${hash}@${effectiveWidth}x${effectiveHeight}.png` + readonly property url cachePath: `${Paths.imagecache}/${hash}@${effectiveWidth}x${effectiveHeight}.png` readonly property real effectiveScale: QsWindow.window?.devicePixelRatio ?? 1 readonly property int effectiveWidth: Math.ceil(width * effectiveScale) @@ -31,8 +32,7 @@ Image { source = path; else if (source == path && status === Image.Ready) { Paths.mkdir(Paths.imagecache); - const grabPath = cachePath; - grabToImage(res => res.saveToFile(grabPath)); + CUtils.saveItem(this, cachePath); } } |