aboutsummaryrefslogtreecommitdiffstats
path: root/notifications/NotificationBalloon.qml
diff options
context:
space:
mode:
Diffstat (limited to 'notifications/NotificationBalloon.qml')
-rw-r--r--notifications/NotificationBalloon.qml24
1 files changed, 17 insertions, 7 deletions
diff --git a/notifications/NotificationBalloon.qml b/notifications/NotificationBalloon.qml
index 6a674b8..a82f5f6 100644
--- a/notifications/NotificationBalloon.qml
+++ b/notifications/NotificationBalloon.qml
@@ -27,18 +27,28 @@ Rectangle {
property var borderColors: []
property real borderAngle: 0
+ // Slides in from the screen edge it sits against. The layer surface maps
+ // once for the whole stack, so a Hyprland layer animation would only
+ // play for the first balloon. The window clips it, so it appears from
+ // the stack's edge rather than from beyond the screen's.
+ transform: Translate { id: slide }
+ NumberAnimation {
+ id: enter
+ target: slide; property: "x"; duration: 260; easing.type: Easing.OutCubic
+ to: 0
+ }
+ Component.onCompleted: {
+ enter.from = Notify.config.balloons.corner.endsWith("left") ? -b.width - 12 : b.width + 12;
+ enter.start();
+ }
+
// Driven by the shell's tick. The balloon drops itself once its expiry
// passes, or while a suppression says so: the drawer and snooze withhold
// everything; a muted app and DND are config.json's call (DND passes
// critical unless dndPassCritical is off). The drawer still lists what
// was withheld, because a list the user opened is not an interruption.
- visible: {
- if (Notify.drawerOpen) return false;
- if (Notify.snoozeUntil > b.now) return false;
- if (NC.withheld(Notify.config, b.notification, Notify.dnd)) return false;
- if (b.notification.expires !== 0 && b.now >= b.notification.expires) return false;
- return true;
- }
+ visible: NC.shown(Notify.config, b.notification, Notify.dnd, Notify.drawerOpen,
+ Notify.snoozeUntil, b.now)
width: parent ? parent.width : 340
implicitHeight: texts.implicitHeight + 20 + (preview.visible ? preview.height + 8 : 0)