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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user