notification center: scrollable list, configurable maxVisible (default 10)

This commit is contained in:
Damocles 2026-04-13 16:07:28 +02:00
parent 29a24b4205
commit 29f14a72f0
3 changed files with 240 additions and 213 deletions

View file

@ -22,7 +22,8 @@ QtObject {
property var notifications: ({
enable: true,
timeout: 3000,
maxPopups: 4
maxPopups: 4,
maxVisible: 10
})
property var mpris: ({
enable: true

View file

@ -131,9 +131,27 @@ M.PopupPanel {
color: M.Theme.base03
}
// Notification list
// Notification list (scrollable)
Item {
width: menuWindow.panelWidth
height: Math.min(notifFlick.contentHeight, _maxHeight)
readonly property real _itemHeight: 60
readonly property real _maxHeight: _itemHeight * (M.Modules.notifications.maxVisible || 10)
Flickable {
id: notifFlick
anchors.fill: parent
contentWidth: width
contentHeight: notifCol.implicitHeight
clip: true
boundsBehavior: Flickable.StopAtBounds
Column {
id: notifCol
width: parent.width
Repeater {
model: M.NotifService.list.slice(0, 20)
model: M.NotifService.list
delegate: Item {
id: notifItem
@ -364,7 +382,10 @@ M.PopupPanel {
onClicked: _dismissAnim.start()
}
}
}
} // Repeater
} // Column
} // Flickable
} // Item
// Empty state
Text {

View file

@ -103,6 +103,11 @@ in
default = 4;
description = "Maximum number of notification popups shown simultaneously.";
};
maxVisible = lib.mkOption {
type = lib.types.int;
default = 10;
description = "Maximum visible notifications in the notification center before scrolling.";
};
};
bluetooth = moduleOpt "bluetooth" (intervalOpt 5000);
network = moduleOpt "network" (intervalOpt 5000);