From 3a9cd59243b4b754cde65d49094a062697433bf6 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 13 Apr 2026 16:59:17 +0200 Subject: [PATCH] C5: render notification image/appIcon in popups and center --- modules/NotifCenter.qml | 19 +++++++++++++++++-- modules/NotifPopup.qml | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/modules/NotifCenter.qml b/modules/NotifCenter.qml index fe0b04c..8a9045b 100644 --- a/modules/NotifCenter.qml +++ b/modules/NotifCenter.qml @@ -225,12 +225,27 @@ M.PopupPanel { } } + Image { + id: ncIcon + anchors.left: parent.left + anchors.leftMargin: 14 + anchors.top: parent.top + anchors.topMargin: 6 + width: 24 + height: 24 + source: notifItem.modelData.image || notifItem.modelData.appIcon || "" + visible: status === Image.Ready + fillMode: Image.PreserveAspectFit + sourceSize: Qt.size(24, 24) + asynchronous: true + } + Column { id: notifContent - anchors.left: parent.left + anchors.left: ncIcon.visible ? ncIcon.right : parent.left anchors.right: dismissBtn.left anchors.top: parent.top - anchors.leftMargin: 14 + anchors.leftMargin: ncIcon.visible ? 6 : 14 anchors.topMargin: 6 spacing: 1 diff --git a/modules/NotifPopup.qml b/modules/NotifPopup.qml index 8e22712..d88f55c 100644 --- a/modules/NotifPopup.qml +++ b/modules/NotifPopup.qml @@ -136,13 +136,28 @@ PanelWindow { shadowHorizontalOffset: 0 } + Image { + id: notifIcon + anchors.left: parent.left + anchors.leftMargin: 14 + anchors.top: parent.top + anchors.topMargin: 8 + width: 36 + height: 36 + source: popupItem.modelData.image || popupItem.modelData.appIcon || "" + visible: status === Image.Ready + fillMode: Image.PreserveAspectFit + sourceSize: Qt.size(36, 36) + asynchronous: true + } + Column { id: contentCol - anchors.left: parent.left + anchors.left: notifIcon.visible ? notifIcon.right : parent.left anchors.right: parent.right anchors.top: parent.top anchors.margins: 8 - anchors.leftMargin: 14 + anchors.leftMargin: notifIcon.visible ? 8 : 14 spacing: 2 // App name + time