notifications: disableable popups, configurable max popup count

This commit is contained in:
Damocles 2026-04-13 15:35:12 +02:00
parent ce62d8f9cd
commit 9358f8fe6e
5 changed files with 28 additions and 4 deletions

View file

@ -83,6 +83,15 @@ QtObject {
root.list = [data, ...root.list];
// Dismiss excess popups (keep in history, just hide popup)
const max = M.Modules.notifications.maxPopups || 4;
const currentPopups = root.list.filter(n => n.popup && !n.closed);
if (currentPopups.length > max) {
for (let i = max; i < currentPopups.length; i++)
currentPopups[i].popup = false;
root._changed();
}
// Auto-expire popup
if (data.popup) {
const timeout = notif.expireTimeout > 0 ? notif.expireTimeout : (M.Modules.notifications.timeout || 3000);