notification sizing changes, better popup layout
This commit is contained in:
+9
-13
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user