notification popups

This commit is contained in:
end-4
2025-04-21 23:29:31 +02:00
parent 5dc0dc133d
commit 54fdf043c9
12 changed files with 240 additions and 46 deletions
@@ -22,6 +22,7 @@ Item {
notificationWidgetList.push(notif)
})
}
function onNotify(notification) {
// notificationRepeater.model = [notification, ...notificationRepeater.model]
const notif = root.notifComponent.createObject(columnLayout, { notificationObject: notification });
@@ -41,6 +42,7 @@ Item {
}
}
}
function onDiscard(id) {
for (let i = notificationWidgetList.length - 1; i >= 0; i--) {
const widget = notificationWidgetList[i];
@@ -50,6 +52,16 @@ Item {
}
}
}
function onDiscardAll() {
for (let i = notificationWidgetList.length - 1; i >= 0; i--) {
const widget = notificationWidgetList[i];
if (widget && widget.notificationObject) {
widget.destroyWithAnimation();
}
}
notificationWidgetList = [];
}
}
Flickable { // Scrollable window
@@ -145,15 +157,7 @@ Item {
buttonIcon: "clear_all"
buttonText: "Clear"
onClicked: () => {
for (let i = notificationWidgetList.length - 1; i >= 0; i--) {
// for (let i = 0; i < notificationWidgetList.length; i++) {
const widget = notificationWidgetList[i];
if (widget && widget.notificationObject) {
widget.destroyWithAnimation();
}
}
notificationWidgetList = [];
Notifications.discardAll()
Notifications.discardAllNotifications()
}
}
}