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:
@@ -131,12 +131,16 @@ Rectangle {
|
||||
height: iconImage.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
source: (
|
||||
notification.appIcon ? Quickshell.iconPath(notification.appIcon) :
|
||||
notification.image ? notification.image :
|
||||
Quickshell.iconPath(DesktopEntries.byId(notification.desktopEntry).icon) ? Quickshell.iconPath(DesktopEntries.byId(notification.desktopEntry).icon) :
|
||||
Quickshell.iconPath("notifications")
|
||||
)
|
||||
source: {
|
||||
if (notification.appIcon) return Quickshell.iconPath(notification.appIcon)
|
||||
if (notification.image) return notification.image
|
||||
const entry = notification.desktopEntry ? DesktopEntries.byId(notification.desktopEntry) : null
|
||||
if (entry && entry.icon) {
|
||||
const p = Quickshell.iconPath(entry.icon)
|
||||
if (p && p !== "") return p
|
||||
}
|
||||
return Quickshell.iconPath("notifications")
|
||||
}
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
asynchronous: true
|
||||
|
||||
Reference in New Issue
Block a user