From 0509694d78c99e3065ab3b09c73bf05df460abb7 Mon Sep 17 00:00:00 2001 From: purian23 Date: Sat, 4 Jul 2026 01:26:56 -0400 Subject: [PATCH] fix(Notifications): update flexible image caching in DankCircularImage - Fixes #2480 --- .../Modules/Notifications/Center/HistoryNotificationCard.qml | 1 + quickshell/Modules/Notifications/Center/NotificationCard.qml | 2 ++ quickshell/Modules/Notifications/Popup/NotificationPopup.qml | 1 + quickshell/Widgets/DankCircularImage.qml | 5 +++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml index 379a9063f..2d283393a 100644 --- a/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/HistoryNotificationCard.qml @@ -113,6 +113,7 @@ Rectangle { DankCircularImage { id: iconContainer + cacheImages: false readonly property string rawImage: historyItem.image || "" readonly property string iconFromImage: { if (rawImage.startsWith("image://icon/")) diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index 57a12fefd..7685cd2dc 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -268,6 +268,7 @@ Rectangle { DankCircularImage { id: iconContainer + cacheImages: false readonly property string rawImage: notificationGroup?.latestNotification?.image || "" readonly property string iconFromImage: { if (rawImage.startsWith("image://icon/")) @@ -610,6 +611,7 @@ Rectangle { DankCircularImage { id: messageIcon + cacheImages: false readonly property string rawImage: modelData?.image || "" readonly property string iconFromImage: { diff --git a/quickshell/Modules/Notifications/Popup/NotificationPopup.qml b/quickshell/Modules/Notifications/Popup/NotificationPopup.qml index adfdf169b..142ea34b1 100644 --- a/quickshell/Modules/Notifications/Popup/NotificationPopup.qml +++ b/quickshell/Modules/Notifications/Popup/NotificationPopup.qml @@ -818,6 +818,7 @@ PanelWindow { DankCircularImage { id: iconContainer + cacheImages: false readonly property string rawImage: notificationData?.image || "" readonly property string iconFromImage: { diff --git a/quickshell/Widgets/DankCircularImage.qml b/quickshell/Widgets/DankCircularImage.qml index 4aa341479..c6d75dce1 100644 --- a/quickshell/Widgets/DankCircularImage.qml +++ b/quickshell/Widgets/DankCircularImage.qml @@ -10,6 +10,7 @@ Rectangle { property string imageSource: "" property string fallbackIcon: "notifications" property string fallbackText: "" + property bool cacheImages: true property bool hasImage: imageSource !== "" readonly property bool shouldProbe: imageSource !== "" && !imageSource.startsWith("image://") // Probe with AnimatedImage first; once loaded, check frameCount to decide. @@ -65,7 +66,7 @@ Rectangle { fillMode: Image.PreserveAspectCrop smooth: true mipmap: true - cache: true + cache: root.cacheImages visible: false source: root.shouldProbe ? root.imageSource : "" } @@ -79,7 +80,7 @@ Rectangle { fillMode: Image.PreserveAspectCrop smooth: true mipmap: true - cache: true + cache: root.cacheImages visible: false sourceSize.width: Math.max(width * 2, 128) sourceSize.height: Math.max(height * 2, 128)