fancy notifs

This commit is contained in:
2026-03-02 19:28:15 +02:00
parent 8fa89bb99c
commit aa8c07b136
8 changed files with 811 additions and 360 deletions

View File

@@ -13,8 +13,8 @@ PanelWindow {
}
margins {
top: 24
right: 24
top: theme.panelMarginTop
right: theme.panelMarginRight
}
// Top layer keeps notifications above normal windows while still usually
@@ -30,13 +30,18 @@ PanelWindow {
visible: true
color: "#00000000"
property int stackWidth: 420
property int menuReservedHeight: 182
NotificationTheme {
id: theme
}
property int stackWidth: theme.stackWidth
property int menuReservedHeight: theme.topbarReservedHeight
readonly property bool stackPreviewEnabled: Boolean(ShellStateManager.global("notifications.stackPreviewEnabled", true))
readonly property int screenHeight: screen ? screen.height : 1080
readonly property bool topbarOpen: ShellStateManager.shellOpen
readonly property int stackOffsetY: topbarOpen ? menuReservedHeight + 24 : 0
readonly property int maxStackHeight: Math.max(120, screenHeight - 24 - stackOffsetY - 24)
readonly property int stackOffsetY: topbarOpen ? menuReservedHeight + theme.panelMarginTop : 0
readonly property int maxStackHeight: Math.max(120, screenHeight - theme.panelMarginTop - stackOffsetY - theme.panelMarginTop)
implicitWidth: stackWidth
implicitHeight: stackOffsetY + notificationViewport.height
@@ -87,22 +92,20 @@ PanelWindow {
spacing: 0
Repeater {
model: notificationModel.notifications
model: notificationModel.groupedNotifications
NotificationCard {
notificationId: rowNotificationId
notifTitle: rowTitle
notifBody: rowBody
notifUrgency: rowUrgency
notifAppName: rowAppName
notifAppIcon: rowAppIcon
notifImage: rowImage
notifTimeoutMs: rowTimeoutMs
notifCritical: rowCritical
notifHints: rowHints
NotificationGroup {
theme: theme
groupData: modelData
expanded: notificationModel.groupIsExpanded(modelData.groupKey)
peekEnabled: notificationLayer.stackPreviewEnabled
width: notificationLayer.stackWidth
onExpandRequested: function (groupKey, shouldExpand) {
notificationModel.setGroupExpanded(groupKey, shouldExpand);
}
onCloseFinished: function (closedNotificationId, reason) {
notificationModel.closeById(closedNotificationId, reason);
}