Make notifications always visible with plain header

This commit is contained in:
Joshua Yuen 2026-09-12 18:25:19 -04:00
parent ed906f27e7
commit deb8146f33
Signed by: josh
GPG Key ID: 530DA0331EFE99F5
2 changed files with 18 additions and 47 deletions

View File

@ -475,18 +475,11 @@ $module-bg: transparentize($base02, 0.4);
padding-top: 8px; padding-top: 8px;
} }
.notif-toggle { .notif-header {
padding: 4px 6px;
border-radius: 6px;
label { label {
font-weight: bold; font-weight: bold;
margin: 0 2px; margin: 0 2px;
} }
&:hover {
background: transparentize($base05, 0.88);
}
} }
.notif-clear { .notif-clear {

View File

@ -68,11 +68,6 @@ function Header() {
export default function QuickSettings(gdkmonitor: Gdk.Monitor) { export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
const open = Variable(false) const open = Variable(false)
const notifOpen = Variable(false)
open.subscribe((v) => {
if (!v) notifOpen.set(false)
})
const button = ( const button = (
<button <button
@ -149,22 +144,11 @@ export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
<MediaSection /> <MediaSection />
<box className="notif-section" vertical spacing={6}> <box className="notif-section" vertical spacing={6}>
<box className="notif-header-row" spacing={6}> <box className="notif-header-row" spacing={6}>
<button <box className="notif-header" spacing={6}>
className="notif-toggle" <icon icon="preferences-system-notifications-symbolic" />
hexpand <label label="Notifications" />
halign={Gtk.Align.START} </box>
onClicked={() => notifOpen.set(!notifOpen.get())} <box hexpand />
>
<box spacing={6}>
<icon icon="preferences-system-notifications-symbolic" />
<label label="Notifications" />
<icon
icon={notifOpen().as((v) =>
v ? "pan-down-symbolic" : "pan-end-symbolic",
)}
/>
</box>
</button>
<button <button
className="notif-clear" className="notif-clear"
onClicked={() => [...notifd.notifications].forEach((n) => n.dismiss())} onClicked={() => [...notifd.notifications].forEach((n) => n.dismiss())}
@ -172,24 +156,18 @@ export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
<label label="Clear" /> <label label="Clear" />
</button> </button>
</box> </box>
<revealer <box className="notifications" vertical>
transitionType={Gtk.RevealerTransitionType.SLIDE_DOWN} <label
transitionDuration={180} className="notif-empty"
revealChild={bind(notifOpen)} label="no notifications"
> visible={notifCount.as((n) => n === 0)}
<box className="notifications" vertical> />
<label {bind(notifd, "notifications").as((ns) =>
className="notif-empty" [...ns]
label="no notifications" .sort((a, b) => b.time - a.time)
visible={notifCount.as((n) => n === 0)} .map((n) => NotificationCard(n)),
/> )}
{bind(notifd, "notifications").as((ns) => </box>
[...ns]
.sort((a, b) => b.time - a.time)
.map((n) => NotificationCard(n)),
)}
</box>
</revealer>
</box> </box>
</Dropdown> </Dropdown>
) )