notifs: make dnd actually work

Also change bar icon and hide count when dnd
This commit is contained in:
2 * r + 2 * t 2025-03-11 15:55:32 +11:00
parent d81454cd91
commit 877c254740
3 changed files with 14 additions and 8 deletions

View file

@ -183,11 +183,6 @@
.status-icons .bluetooth {
@include lib.spacing(10, true);
// The spacing doesn't look right for some reason so this
& > :first-child:not(:last-child) {
margin-bottom: lib.s(5);
}
}
}
}

View file

@ -459,8 +459,19 @@ const NotifCount = () => (
}
>
<box vertical={bind(config.vertical)} className="module notif-count">
<label className="icon" label="info" />
<label label={bind(AstalNotifd.get_default(), "notifications").as(n => String(n.length))} />
<label
className="icon"
label={bind(AstalNotifd.get_default(), "dontDisturb").as(d => (d ? "notifications_off" : "info"))}
/>
<revealer
transitionType={bind(config.vertical).as(v =>
v ? Gtk.RevealerTransitionType.SLIDE_DOWN : Gtk.RevealerTransitionType.SLIDE_RIGHT
)}
transitionDuration={120}
revealChild={bind(AstalNotifd.get_default(), "dontDisturb").as(d => !d)}
>
<label label={bind(AstalNotifd.get_default(), "notifications").as(n => String(n.length))} />
</revealer>
</box>
</button>
);

View file

@ -19,7 +19,7 @@ export default () => (
let notifsOpen = false;
self.hook(notifd, "notified", (self, id) => {
if (notifsOpen) return;
if (notifsOpen || notifd.dontDisturb) return;
const notification = notifd.get_notification(id);