notification sizing changes, better popup layout

This commit is contained in:
Zacharias-Brohn
2025-11-15 23:43:46 +01:00
parent 800fff4fcc
commit e6a06349e0
8 changed files with 158 additions and 87 deletions
+9 -13
View File
@@ -1,21 +1,14 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Services.Notifications
import QtQuick
import qs.Modules
Rectangle {
Scope {
id: root
Text {
text: "\ue7f4"
font.family: "Material Symbols Rounded"
font.pixelSize: 16
color: "white"
anchors.centerIn: parent
}
property list<int> notifIds: []
property list<TrackedNotification> notifications;
NotificationServer {
id: notificationServer
imageSupported: true
@@ -23,20 +16,23 @@ Rectangle {
persistenceSupported: true
bodyImagesSupported: true
bodySupported: true
onNotification: {
onNotification: notification => {
notification.tracked = true;
notification.receivedTime = Date.now();
root.notifIds.push(notification.id);
notificationComponent.createObject(root, { notif: notification, visible: !notificationCenter.doNotDisturb });
const notif = notificationComponent.createObject(root, { notif: notification, visible: !notificationCenter.doNotDisturb });
root.notifications.push(notif);
}
}
Component {
id: notificationComponent
Notification {
TrackedNotification {
centerX: notificationCenter.posX
notifIndex: root.notifIds
notifList: root.notifications
onNotifDestroy: {
root.notifications.shift();
root.notifIds.shift();
}
}