Make notifications always visible with plain header
This commit is contained in:
parent
09e540c9e6
commit
9244f1f54c
|
|
@ -475,18 +475,11 @@ $module-bg: transparentize($base02, 0.4);
|
|||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.notif-toggle {
|
||||
padding: 4px 6px;
|
||||
border-radius: 6px;
|
||||
|
||||
.notif-header {
|
||||
label {
|
||||
font-weight: bold;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: transparentize($base05, 0.88);
|
||||
}
|
||||
}
|
||||
|
||||
.notif-clear {
|
||||
|
|
|
|||
|
|
@ -68,11 +68,6 @@ function Header() {
|
|||
|
||||
export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
|
||||
const open = Variable(false)
|
||||
const notifOpen = Variable(false)
|
||||
|
||||
open.subscribe((v) => {
|
||||
if (!v) notifOpen.set(false)
|
||||
})
|
||||
|
||||
const button = (
|
||||
<button
|
||||
|
|
@ -149,22 +144,11 @@ export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
|
|||
<MediaSection />
|
||||
<box className="notif-section" vertical spacing={6}>
|
||||
<box className="notif-header-row" spacing={6}>
|
||||
<button
|
||||
className="notif-toggle"
|
||||
hexpand
|
||||
halign={Gtk.Align.START}
|
||||
onClicked={() => notifOpen.set(!notifOpen.get())}
|
||||
>
|
||||
<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>
|
||||
<box className="notif-header" spacing={6}>
|
||||
<icon icon="preferences-system-notifications-symbolic" />
|
||||
<label label="Notifications" />
|
||||
</box>
|
||||
<box hexpand />
|
||||
<button
|
||||
className="notif-clear"
|
||||
onClicked={() => [...notifd.notifications].forEach((n) => n.dismiss())}
|
||||
|
|
@ -172,24 +156,18 @@ export default function QuickSettings(gdkmonitor: Gdk.Monitor) {
|
|||
<label label="Clear" />
|
||||
</button>
|
||||
</box>
|
||||
<revealer
|
||||
transitionType={Gtk.RevealerTransitionType.SLIDE_DOWN}
|
||||
transitionDuration={180}
|
||||
revealChild={bind(notifOpen)}
|
||||
>
|
||||
<box className="notifications" vertical>
|
||||
<label
|
||||
className="notif-empty"
|
||||
label="no notifications"
|
||||
visible={notifCount.as((n) => n === 0)}
|
||||
/>
|
||||
{bind(notifd, "notifications").as((ns) =>
|
||||
[...ns]
|
||||
.sort((a, b) => b.time - a.time)
|
||||
.map((n) => NotificationCard(n)),
|
||||
)}
|
||||
</box>
|
||||
</revealer>
|
||||
<box className="notifications" vertical>
|
||||
<label
|
||||
className="notif-empty"
|
||||
label="no notifications"
|
||||
visible={notifCount.as((n) => n === 0)}
|
||||
/>
|
||||
{bind(notifd, "notifications").as((ns) =>
|
||||
[...ns]
|
||||
.sort((a, b) => b.time - a.time)
|
||||
.map((n) => NotificationCard(n)),
|
||||
)}
|
||||
</box>
|
||||
</box>
|
||||
</Dropdown>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue