nosignal-shell/components/images/CachingImage.qml
2 * r + 2 * t 4f60c07e05 plugin: create caching image manager
No need for external proc
2025-08-27 20:32:51 +10:00

29 lines
555 B
QML

import qs.utils
import Caelestia
import QtQuick
Image {
id: root
property alias path: manager.path
property int sourceWidth
property int sourceHeight
asynchronous: true
fillMode: Image.PreserveAspectCrop
sourceSize.width: sourceWidth
sourceSize.height: sourceHeight
onStatusChanged: {
if (!manager.usingCache && status === Image.Ready)
CUtils.saveItem(this, manager.cachePath);
}
CachingImageManager {
id: manager
item: root
cacheDir: Paths.imagecache
}
}