diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-05 19:06:32 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-05 19:06:32 +1000 |
| commit | 1a650b73bc75a7b617d9e0c24d680eae47218f3d (patch) | |
| tree | 33d7d5d76733bff274eda57fe7b3f93f7534f7c6 /modules | |
| parent | wallpaper: limit source size (diff) | |
| download | caelestia-shell-1a650b73bc75a7b617d9e0c24d680eae47218f3d.tar.gz caelestia-shell-1a650b73bc75a7b617d9e0c24d680eae47218f3d.tar.bz2 caelestia-shell-1a650b73bc75a7b617d9e0c24d680eae47218f3d.zip | |
thumbnailer: better caching
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/background/Wallpaper.qml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml index 2ffc922..78624d5 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -28,23 +28,25 @@ Item { id: two } - component Img: Image { + component Img: CachingImage { id: img function update(): void { - if (source === root.source) + const srcPath = `${root.source}`.slice(7); + if (thumbnail.originalPath === srcPath) { root.current = this; - else - source = root.source; + } else + path = srcPath; } anchors.fill: parent + asynchronous: true + cache: false fillMode: Image.PreserveAspectCrop + opacity: 0 scale: Wallpapers.showPreview ? 1 : 0.8 - sourceSize.width: width - sourceSize.height: height onStatusChanged: { if (status === Image.Ready) |