mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-08 06:28:27 -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;
|
const icon = iconFromImage;
|
||||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
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
|
width: iconSize
|
||||||
height: iconSize
|
height: iconSize
|
||||||
@@ -132,7 +133,7 @@ Rectangle {
|
|||||||
|
|
||||||
imageSource: {
|
imageSource: {
|
||||||
if (hasNotificationImage)
|
if (hasNotificationImage)
|
||||||
return historyItem.image;
|
return resolvedImage;
|
||||||
if (imageHasSpecialPrefix)
|
if (imageHasSpecialPrefix)
|
||||||
return "";
|
return "";
|
||||||
const appIcon = historyItem.appIcon;
|
const appIcon = historyItem.appIcon;
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ Rectangle {
|
|||||||
const icon = iconFromImage;
|
const icon = iconFromImage;
|
||||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
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
|
width: iconSize
|
||||||
height: iconSize
|
height: iconSize
|
||||||
@@ -606,7 +606,7 @@ Rectangle {
|
|||||||
const icon = iconFromImage;
|
const icon = iconFromImage;
|
||||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
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
|
width: expandedIconSize
|
||||||
height: expandedIconSize
|
height: expandedIconSize
|
||||||
|
|||||||
@@ -814,8 +814,8 @@ PanelWindow {
|
|||||||
const icon = iconFromImage;
|
const icon = iconFromImage;
|
||||||
return icon.startsWith("material:") || icon.startsWith("svg:") || icon.startsWith("unicode:") || icon.startsWith("image:");
|
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 bool needsImagePersist: hasNotificationImage && rawImage.startsWith("image://qsimage/") && !notificationData.persistedImagePath
|
readonly property bool needsImagePersist: hasNotificationImage && (rawImage.startsWith("image://qsimage/") || iconFromImage.startsWith("/")) && !notificationData.persistedImagePath
|
||||||
|
|
||||||
width: popupIconSize
|
width: popupIconSize
|
||||||
height: popupIconSize
|
height: popupIconSize
|
||||||
|
|||||||
@@ -866,6 +866,11 @@ Singleton {
|
|||||||
readonly property string cleanImage: {
|
readonly property string cleanImage: {
|
||||||
if (!image)
|
if (!image)
|
||||||
return "";
|
return "";
|
||||||
|
if (image.startsWith("image://icon/")) {
|
||||||
|
const payload = image.substring(13);
|
||||||
|
if (payload.startsWith("/"))
|
||||||
|
return "file://" + payload;
|
||||||
|
}
|
||||||
return Paths.strip(image);
|
return Paths.strip(image);
|
||||||
}
|
}
|
||||||
property int urgencyOverride: notification?.urgency ?? NotificationUrgency.Normal
|
property int urgencyOverride: notification?.urgency ?? NotificationUrgency.Normal
|
||||||
|
|||||||
Reference in New Issue
Block a user