feat: refactor notification body to use a more concise conditional expression for handling app icons, images, and desktop entry icons

This commit is contained in:
Hannes
2026-08-31 16:34:18 +02:00
parent 47562185f1
commit 2c38de7c60
+10 -6
View File
@@ -131,12 +131,16 @@ Rectangle {
height: iconImage.width height: iconImage.width
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
source: ( source: {
notification.appIcon ? Quickshell.iconPath(notification.appIcon) : if (notification.appIcon) return Quickshell.iconPath(notification.appIcon)
notification.image ? notification.image : if (notification.image) return notification.image
Quickshell.iconPath(DesktopEntries.byId(notification.desktopEntry).icon) ? Quickshell.iconPath(DesktopEntries.byId(notification.desktopEntry).icon) : const entry = notification.desktopEntry ? DesktopEntries.byId(notification.desktopEntry) : null
Quickshell.iconPath("notifications") if (entry && entry.icon) {
) const p = Quickshell.iconPath(entry.icon)
if (p && p !== "") return p
}
return Quickshell.iconPath("notifications")
}
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
asynchronous: true asynchronous: true