notifications: centralize icon resolution in NotifItem.resolvedIcon, fix lock pill grouping and missing fallbacks

This commit is contained in:
Damocles 2026-04-29 17:58:26 +02:00
parent 99b63a2756
commit d4001f7900
4 changed files with 23 additions and 32 deletions

View file

@ -1,5 +1,4 @@
import QtQuick
import Quickshell
import Quickshell.Services.Notifications
import "." as M
import "../services" as S
@ -87,15 +86,7 @@ Item {
anchors.topMargin: 8
width: root.iconSize
height: root.iconSize
source: {
const img = root.notif?.image;
if (img)
return img;
const ic = root.notif?.appIcon;
if (!ic)
return "";
return (ic.startsWith("/") || ic.startsWith("file://")) ? ic : Quickshell.iconPath(ic, "dialog-information");
}
source: root.notif?.resolvedIcon ?? ""
visible: status === Image.Ready
fillMode: Image.PreserveAspectFit
sourceSize: Qt.size(root.iconSize, root.iconSize)