Made notification panel scrollable

This commit is contained in:
2026-05-12 00:00:38 -04:00
parent 5d7d03a441
commit 2b6c1b1fc8
2 changed files with 106 additions and 114 deletions

View File

@@ -14,14 +14,11 @@ Item {
required property real notificationRounding
property real spacing: 8
Layout.fillWidth: true
implicitWidth: textWidth
implicitHeight: content.implicitHeight
ColumnLayout {
id: content
Layout.fillWidth: true
spacing: 0
Rectangle {
implicitHeight: appTitle.implicitHeight
@@ -33,8 +30,8 @@ Item {
RowLayout {
spacing: 0 // For some reason, adding a spacing of just the value will not work properly
IconImage {
visible: root.notif.appIcon.length > 0
id: appIcon
visible: root.notif.appIcon.length > 0
source: Quickshell.iconPath(root.notif.appIcon)
width: appTitle.height - root.spacing
height: appTitle.height - root.spacing
@@ -61,20 +58,20 @@ Item {
id: body
spacing: root.spacing
Text {
id: notifSummary
visible: root.notif.summary.length > 0
Layout.leftMargin: root.spacing
Layout.rightMargin: root.spacing
id: notifSummary
text: root.notif.summary
color: Appearance.colors.colOnLayer2
wrapMode: Text.WordWrap
}
Text {
id: notifBody
visible: root.notif.body.length > 0
Layout.leftMargin: root.spacing
Layout.rightMargin: root.spacing
Layout.preferredWidth: textWidth
id: notifBody
text: root.notif.body
color: Appearance.colors.colOnLayer2
wrapMode: Text.WordWrap

View File

@@ -64,32 +64,27 @@ Scope {
hideTimer.stop();
}
ColumnLayout {
ListView {
id: notifs
anchors.fill: parent
anchors.margins: 4
Layout.fillWidth: true
anchors.left: parent.left
anchors.right: parent.right
visible: NotificationService.amountNotifications > 0
// Dismiss All Button
RippleButton {
clip: true
spacing: 4
model: NotificationService.notifications
header: RippleButton {
buttonText: "Dismiss All"
buttonTextColor: Appearance.m3colors.m3onTertiaryContainer
colBackground: Appearance.m3colors.m3tertiaryContainer
releaseAction: NotificationService.dismissAll
buttonRadius: Appearance.rounding.unsharpenmore
Layout.fillWidth: true
width: notifs.width - 8
}
Repeater {
model: NotificationService.notifications
NotificationItem {
delegate: NotificationItem {
required property Notification modelData
notif: modelData
textWidth: root.panelWidth - 14
textWidth: notifs.width - 8
notificationRounding: Appearance.rounding.unsharpenmore
}
Layout.fillWidth: true
}
}
}