From bc3006838389d1628e4beb968cc49c1df7472765 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Fri, 13 Jun 2025 18:54:14 -0300 Subject: [PATCH] :lipstick: floating-notifications: better appearance, use gtk's spacing instead of margin --- ags/style/_float-notifications.scss | 18 +++++++++++------- ags/window/FloatingNotifications.ts | 10 +++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ags/style/_float-notifications.scss b/ags/style/_float-notifications.scss index d743704..8126592 100644 --- a/ags/style/_float-notifications.scss +++ b/ags/style/_float-notifications.scss @@ -2,13 +2,17 @@ @use "./mixins"; .floating-notifications-container { - padding: { - right: 6px; - top: 6px; - }; + padding: 16px; - & .notification { - margin: 6px; - box-shadow: 0 0 4px .5px colors.$bg-primary; + & .float-notification { + $radius: 18px; + + box-shadow: 0 0 8px 1px colors.$bg-translucent; + border-radius: $radius; + + & .notification { + padding: 4px; + border-radius: $radius; + } } } diff --git a/ags/window/FloatingNotifications.ts b/ags/window/FloatingNotifications.ts index 732ed02..ceb018e 100644 --- a/ags/window/FloatingNotifications.ts +++ b/ags/window/FloatingNotifications.ts @@ -16,11 +16,15 @@ export const FloatingNotifications = (mon: number) => new Widget.Window({ className: "floating-notifications-container", orientation: Gtk.Orientation.VERTICAL, homogeneous: false, + spacing: 12, visible: bind(Notifications.getDefault(), "notifications").as(notifs => notifs.length > 0), children: bind(Notifications.getDefault(), "notifications").as((notifs) => - notifs.map((item) => NotificationWidget(item, - () => Notifications.getDefault().removeNotification(item), - false, true)) + notifs.map((item) => new Widget.Box({ + className: "float-notification", + child: NotificationWidget(item, + () => Notifications.getDefault().removeNotification(item), + false, true) + } as Widget.BoxProps)) ), } as Widget.BoxProps) } as Widget.WindowProps);