mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
fix(Notifications): update hasNotificationImage logic to support file paths
- Fixes #2533
This commit is contained in:
@@ -123,7 +123,8 @@ Rectangle {
|
||||
const icon = iconFromImage;
|
||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
||||
}
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && !rawImage.startsWith("image://icon/")
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && (!rawImage.startsWith("image://icon/") || iconFromImage.startsWith("/"))
|
||||
readonly property string resolvedImage: iconFromImage.startsWith("/") ? ("file://" + iconFromImage) : rawImage
|
||||
|
||||
width: iconSize
|
||||
height: iconSize
|
||||
@@ -132,7 +133,7 @@ Rectangle {
|
||||
|
||||
imageSource: {
|
||||
if (hasNotificationImage)
|
||||
return historyItem.image;
|
||||
return resolvedImage;
|
||||
if (imageHasSpecialPrefix)
|
||||
return "";
|
||||
const appIcon = historyItem.appIcon;
|
||||
|
||||
@@ -263,7 +263,7 @@ Rectangle {
|
||||
const icon = iconFromImage;
|
||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
||||
}
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && !rawImage.startsWith("image://icon/")
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && (!rawImage.startsWith("image://icon/") || iconFromImage.startsWith("/"))
|
||||
|
||||
width: iconSize
|
||||
height: iconSize
|
||||
@@ -606,7 +606,7 @@ Rectangle {
|
||||
const icon = iconFromImage;
|
||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
||||
}
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && !rawImage.startsWith("image://icon/")
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && (!rawImage.startsWith("image://icon/") || iconFromImage.startsWith("/"))
|
||||
|
||||
width: expandedIconSize
|
||||
height: expandedIconSize
|
||||
|
||||
@@ -814,8 +814,8 @@ PanelWindow {
|
||||
const icon = iconFromImage;
|
||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
||||
}
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && !rawImage.startsWith("image://icon/")
|
||||
readonly property bool needsImagePersist: hasNotificationImage && rawImage.startsWith("image://qsimage/") && !notificationData.persistedImagePath
|
||||
readonly property bool hasNotificationImage: rawImage !== "" && (!rawImage.startsWith("image://icon/") || iconFromImage.startsWith("/"))
|
||||
readonly property bool needsImagePersist: hasNotificationImage && (rawImage.startsWith("image://qsimage/") || iconFromImage.startsWith("/")) && !notificationData.persistedImagePath
|
||||
|
||||
width: popupIconSize
|
||||
height: popupIconSize
|
||||
|
||||
@@ -866,6 +866,11 @@ Singleton {
|
||||
readonly property string cleanImage: {
|
||||
if (!image)
|
||||
return "";
|
||||
if (image.startsWith("image://icon/")) {
|
||||
const payload = image.substring(13);
|
||||
if (payload.startsWith("/"))
|
||||
return "file://" + payload;
|
||||
}
|
||||
return Paths.strip(image);
|
||||
}
|
||||
property int urgencyOverride: notification?.urgency ?? NotificationUrgency.Normal
|
||||
|
||||
Reference in New Issue
Block a user