From 3cc23a89e09377f0bcbf07829cd308b59249f65c Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 15 Jul 2024 05:41:01 +0545 Subject: [PATCH] updates --- config/ags/modules/bar.ts | 3 +-- config/ags/modules/notificationPopups.ts | 19 +++++++++++++++---- config/ags/modules/sideright/notifications.ts | 5 ++++- config/ags/style.css | 10 +++++++++- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/config/ags/modules/bar.ts b/config/ags/modules/bar.ts index 4c4f37bc..350274c4 100644 --- a/config/ags/modules/bar.ts +++ b/config/ags/modules/bar.ts @@ -229,8 +229,7 @@ function SysTray() { const items = systemtray.items; // @ts-expect-error self.children = items.map((item) => { - if (!item.id) - return undefined; + if (!item.id) return undefined; if (item.id.trim() != "nm-applet" && item.id.trim() != "blueman") { return Widget.Button({ child: Widget.Icon({ icon: item.bind("icon") }), diff --git a/config/ags/modules/notificationPopups.ts b/config/ags/modules/notificationPopups.ts index f693571a..729ba877 100644 --- a/config/ags/modules/notificationPopups.ts +++ b/config/ags/modules/notificationPopups.ts @@ -155,11 +155,13 @@ const NotificationReveal = (notification: NotificationType, visible = false, dis count: number; id: number; app: string; + destroying: boolean; }; let box: Box; const destroyWithAnims = () => { + box.attribute.destroying = true; secondRevealer.reveal_child = false; timeout(transition_duration, () => { firstRevealer.reveal_child = false; @@ -175,7 +177,8 @@ const NotificationReveal = (notification: NotificationType, visible = false, dis destroyWithAnims: destroyWithAnims, count: 0, id: notification.id, - app: notification.app_name + app: notification.app_name, + destroying: false }, children: [firstRevealer] }); @@ -206,17 +209,24 @@ export function NotificationPopups( const prev = list.children[i - 1]; let is_last = true; let is_first = true; - if (next) { + let margin_bottom = false; + if (next && !next?.attribute.destroying) { if (next.attribute.app === current.attribute.app) { is_last = false; } } - if (prev) { + if (prev && !prev?.attribute.destroying) { if (prev.attribute.app === current.attribute.app) { is_first = false; } } + if (next) { + if (!(next.attribute.app === current.attribute.app)) { + margin_bottom = true; + } + } current.toggleClassName("last", is_last); + current.toggleClassName("margin_bottom", margin_bottom); current.toggleClassName("first", is_first); current.toggleClassName("middle", !is_first && !is_last); } @@ -256,7 +266,8 @@ export function NotificationPopups( if (original.attribute.count <= 0) { original.attribute.destroyWithAnims(); } - original.connect("destroy", () => onChange()) + onChange(); + original.connect("destroy", () => onChange()); } list.hook(notifications, onNotified, "notified").hook(notifications, onDismissed, dismiss ? "dismissed" : "closed"); diff --git a/config/ags/modules/sideright/notifications.ts b/config/ags/modules/sideright/notifications.ts index 7fc40bef..aa4b872d 100644 --- a/config/ags/modules/sideright/notifications.ts +++ b/config/ags/modules/sideright/notifications.ts @@ -39,11 +39,13 @@ const NotificationReveal = (notification: NotificationType, visible = false, dis count: number; id: number; app: string; + destroying: boolean; }; let box: Box; const destroyWithAnims = () => { + box.attribute.destroying = true; secondRevealer.reveal_child = false; Utils.timeout(transition_duration, () => { firstRevealer.reveal_child = false; @@ -58,7 +60,8 @@ const NotificationReveal = (notification: NotificationType, visible = false, dis destroyWithAnims: destroyWithAnims, count: 0, id: notification.id, - app: notification.app_name + app: notification.app_name, + destroying: false }, children: [firstRevealer] }); diff --git a/config/ags/style.css b/config/ags/style.css index d2f82ac0..041fc854 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -533,12 +533,15 @@ window.notification-popups box.notifications { transition: all 0.2s ease-in-out, border-radius 0.1s ease-in-out; } -.notifications_sidebar_scrollable viewport > box > .first .notification{ +.notifications_sidebar_scrollable viewport > box > .first .notification { border-radius: 14px 14px 6px 6px; } .notifications_sidebar_scrollable viewport > box > .last .notification { border-radius: 6px 6px 14px 14px; +} + +.notifications_sidebar_scrollable viewport > box > .margin_bottom .notification { margin-bottom: 10px; } @@ -1421,6 +1424,10 @@ switch:checked:active slider { margin-left: 2px; } +.sideleft .message label { + color: @onSurface; +} + .sideleft .message.ephemeral { background-color: @surface; box-shadow: none; @@ -1511,6 +1518,7 @@ switch:checked:active slider { } } + /* ----------------------------------------------------- * Material * ----------------------------------------------------- */