1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

notifications: add image persistence

This commit is contained in:
bbedward
2026-01-03 19:56:08 -05:00
parent 913bb2ff67
commit aa72eacae7
5 changed files with 93 additions and 5 deletions

View File

@@ -362,6 +362,7 @@ PanelWindow {
id: iconContainer
readonly property bool hasNotificationImage: notificationData && notificationData.image && notificationData.image !== ""
readonly property bool needsImagePersist: hasNotificationImage && notificationData.image.startsWith("image://qsimage/") && !notificationData.persistedImagePath
width: 63
height: 63
@@ -391,6 +392,22 @@ PanelWindow {
const appName = notificationData?.appName || "?";
return appName.charAt(0).toUpperCase();
}
onImageStatusChanged: {
if (imageStatus === Image.Ready && needsImagePersist) {
const cachePath = NotificationService.getImageCachePath(notificationData);
saveImageToFile(cachePath);
}
}
onImageSaved: filePath => {
if (!notificationData)
return;
notificationData.persistedImagePath = filePath;
const wrapperId = notificationData.notification?.id?.toString() || "";
if (wrapperId)
NotificationService.updateHistoryImage(wrapperId, filePath);
}
}
Rectangle {