summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-16 02:22:13 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-16 02:22:13 +1100
commit2d000c1052e50c6a1c36db91d998bc6fa4b1ba59 (patch)
tree5d0d8b18cf67e98d162af6e134ee2b72ebcf1c62 /services
parentinternal: fix lock null warnings (diff)
downloadcaelestia-shell-2d000c1052e50c6a1c36db91d998bc6fa4b1ba59.tar.gz
caelestia-shell-2d000c1052e50c6a1c36db91d998bc6fa4b1ba59.tar.bz2
caelestia-shell-2d000c1052e50c6a1c36db91d998bc6fa4b1ba59.zip
notifs: fix image caching
Diffstat (limited to '')
-rw-r--r--services/Notifs.qml22
1 files changed, 13 insertions, 9 deletions
diff --git a/services/Notifs.qml b/services/Notifs.qml
index 4a89c7f..2ebc32d 100644
--- a/services/Notifs.qml
+++ b/services/Notifs.qml
@@ -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()
}
}
}