notifs: fix image caching

This commit is contained in:
2 * r + 2 * t 2026-01-16 02:22:13 +11:00
parent 4da25b5e95
commit 2d000c1052

View file

@ -195,15 +195,8 @@ Singleton {
mask: Region {}
Image {
anchors.fill: parent
source: Qt.resolvedUrl(notif.image)
fillMode: Image.PreserveAspectCrop
cache: false
asynchronous: true
opacity: 0
onStatusChanged: {
if (status !== Image.Ready)
function tryCache(): void {
if (status !== Image.Ready || width != Config.notifs.sizes.image || height != Config.notifs.sizes.image)
return;
const cacheKey = notif.appName + notif.summary + notif.id;
@ -225,6 +218,17 @@ Singleton {
notif.dummyImageLoader.active = false;
});
}
anchors.fill: parent
source: Qt.resolvedUrl(notif.image)
fillMode: Image.PreserveAspectCrop
cache: false
asynchronous: true
opacity: 0
onStatusChanged: tryCache()
onWidthChanged: tryCache()
onHeightChanged: tryCache()
}
}
}