mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-03 19:01:50 +00:00
NotificationHistory: add app icon display
This commit is contained in:
@@ -139,6 +139,17 @@ NPanel {
|
|||||||
anchors.margins: Style.marginM * scaling
|
anchors.margins: Style.marginM * scaling
|
||||||
spacing: 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
|
// Notification content column
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -211,14 +211,15 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a simplified copy into persistent history
|
|
||||||
function addToHistory(notification) {
|
function addToHistory(notification) {
|
||||||
const resolvedAppName = resolveAppName(notification)
|
const resolvedAppName = resolveAppName(notification)
|
||||||
|
const resolvedImage = resolveNotificationImage(notification)
|
||||||
|
|
||||||
historyModel.insert(0, {
|
historyModel.insert(0, {
|
||||||
"summary": notification.summary,
|
"summary": notification.summary,
|
||||||
"body": notification.body,
|
"body": notification.body,
|
||||||
"appName": resolvedAppName,
|
"appName": resolvedAppName,
|
||||||
|
"image": resolvedImage,
|
||||||
"urgency": notification.urgency,
|
"urgency": notification.urgency,
|
||||||
"timestamp": new Date()
|
"timestamp": new Date()
|
||||||
})
|
})
|
||||||
@@ -249,6 +250,7 @@ Singleton {
|
|||||||
"summary": it.summary || "",
|
"summary": it.summary || "",
|
||||||
"body": it.body || "",
|
"body": it.body || "",
|
||||||
"appName": it.appName || "",
|
"appName": it.appName || "",
|
||||||
|
"image": it.image || "",
|
||||||
"urgency": it.urgency,
|
"urgency": it.urgency,
|
||||||
"timestamp": ts ? new Date(ts) : new Date()
|
"timestamp": ts ? new Date(ts) : new Date()
|
||||||
})
|
})
|
||||||
@@ -268,6 +270,7 @@ Singleton {
|
|||||||
"summary": n.summary,
|
"summary": n.summary,
|
||||||
"body": n.body,
|
"body": n.body,
|
||||||
"appName": n.appName,
|
"appName": n.appName,
|
||||||
|
"image": n.image,
|
||||||
"urgency": n.urgency,
|
"urgency": n.urgency,
|
||||||
"timestamp"// Always persist in milliseconds
|
"timestamp"// Always persist in milliseconds
|
||||||
: (n.timestamp instanceof Date) ? n.timestamp.getTime(
|
: (n.timestamp instanceof Date) ? n.timestamp.getTime(
|
||||||
|
|||||||
Reference in New Issue
Block a user