From 2b18ed3c41e4e8884bff48eaf4e0bfff0ca9cd20 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Wed, 10 Sep 2025 12:47:04 +0200 Subject: [PATCH] NotificationHistory: add app icon display --- Modules/Notification/NotificationHistoryPanel.qml | 11 +++++++++++ Services/NotificationService.qml | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Modules/Notification/NotificationHistoryPanel.qml b/Modules/Notification/NotificationHistoryPanel.qml index 3d90b9b..a0704c6 100644 --- a/Modules/Notification/NotificationHistoryPanel.qml +++ b/Modules/Notification/NotificationHistoryPanel.qml @@ -139,6 +139,17 @@ NPanel { anchors.margins: Style.marginM * scaling spacing: Style.marginM * scaling + // App icon (same style as popup) + NImageCircled { + Layout.preferredWidth: 28 * scaling + Layout.preferredHeight: 28 * scaling + Layout.alignment: Qt.AlignVCenter + imagePath: image && image !== "" ? image : "" + borderColor: Color.transparent + borderWidth: 0 + visible: (image && image !== "") + } + // Notification content column ColumnLayout { Layout.fillWidth: true diff --git a/Services/NotificationService.qml b/Services/NotificationService.qml index 69fc80f..db42f73 100644 --- a/Services/NotificationService.qml +++ b/Services/NotificationService.qml @@ -211,14 +211,15 @@ Singleton { } } - // Add a simplified copy into persistent history function addToHistory(notification) { const resolvedAppName = resolveAppName(notification) + const resolvedImage = resolveNotificationImage(notification) historyModel.insert(0, { "summary": notification.summary, "body": notification.body, "appName": resolvedAppName, + "image": resolvedImage, "urgency": notification.urgency, "timestamp": new Date() }) @@ -249,6 +250,7 @@ Singleton { "summary": it.summary || "", "body": it.body || "", "appName": it.appName || "", + "image": it.image || "", "urgency": it.urgency, "timestamp": ts ? new Date(ts) : new Date() }) @@ -268,6 +270,7 @@ Singleton { "summary": n.summary, "body": n.body, "appName": n.appName, + "image": n.image, "urgency": n.urgency, "timestamp"// Always persist in milliseconds : (n.timestamp instanceof Date) ? n.timestamp.getTime(