listview tests, broken

This commit is contained in:
Zacharias-Brohn
2025-11-17 11:21:07 +01:00
parent e6a06349e0
commit e1469df7ff
8 changed files with 498 additions and 151 deletions
+52
View File
@@ -0,0 +1,52 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Services.Notifications
import QtQuick
import qs.Modules
Scope {
id: root
property list<int> notifIds: []
property list<TrackedNotification> notifications;
// NotificationServer {
// id: notificationServer
// imageSupported: true
// actionsSupported: true
// persistenceSupported: true
// bodyImagesSupported: true
// bodySupported: true
// onNotification: notification => {
// notification.tracked = true;
// notification.receivedTime = Date.now();
// root.notifIds.push(notification.id);
// const notif = notificationComponent.createObject(root, { notif: notification, visible: !notificationCenter.doNotDisturb });
// root.notifications.push(notif);
// }
// }
Connections {
target: NotifServer.server
function onNotification() {
notificationComponent.createObject( root, { notif: NotifServer.list[0] });
}
}
Component {
id: notificationComponent
TrackedNotification {
centerX: notificationCenter.posX
notifIndex: root.notifIds
notifList: root.notifications
onNotifDestroy: {
root.notifications.shift();
root.notifIds.shift();
}
}
}
NotificationCenter {
id: notificationCenter
notifications: notificationServer.trackedNotifications.values
}
}