From d8881b9eca2d8239d41fa18adae21e963219a9a6 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 27 Nov 2023 15:15:02 -0500 Subject: [PATCH] fix(wim ags): fix notif button --- .../config/ags/js/bar/buttons/notif-button.js | 51 ++++++++++--------- .../config/ags/scss/widgets/traybuttons.scss | 7 --- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/devices/wim/config/ags/js/bar/buttons/notif-button.js b/devices/wim/config/ags/js/bar/buttons/notif-button.js index abe14fd..09f7292 100644 --- a/devices/wim/config/ags/js/bar/buttons/notif-button.js +++ b/devices/wim/config/ags/js/bar/buttons/notif-button.js @@ -1,9 +1,12 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; -import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +import { Box, CenterBox, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import EventBox from '../../misc/cursorbox.js'; +import Separator from '../../misc/separator.js'; + +const SPACING = 4; export default () => EventBox({ @@ -17,30 +20,32 @@ export default () => EventBox({ } }]], - child: Box({ + child: CenterBox({ className: 'notif-panel', - vertical: false, - children: [ - Icon({ - hpack: 'center', - connections: [[Notifications, (self) => { - if (Notifications.dnd) { - self.icon = 'notification-disabled-symbolic'; - } - else if (Notifications.notifications.length > 0) { - self.icon = 'notification-new-symbolic'; - } - else { - self.icon = 'notification-symbolic'; - } - }]], - }), - Label({ - binds: [['label', Notifications, 'notifications', - (n) => String(n.length)]], - }), + center_widget: Box({ + children: [ + Icon({ + connections: [[Notifications, (self) => { + if (Notifications.dnd) { + self.icon = 'notification-disabled-symbolic'; + } + else if (Notifications.notifications.length > 0) { + self.icon = 'notification-new-symbolic'; + } + else { + self.icon = 'notification-symbolic'; + } + }]], + }), - ], + Separator(SPACING), + + Label({ + binds: [['label', Notifications, 'notifications', + (n) => String(n.length)]], + }), + ], + }), }), }); diff --git a/devices/wim/config/ags/scss/widgets/traybuttons.scss b/devices/wim/config/ags/scss/widgets/traybuttons.scss index 8291edb..5b0e98c 100644 --- a/devices/wim/config/ags/scss/widgets/traybuttons.scss +++ b/devices/wim/config/ags/scss/widgets/traybuttons.scss @@ -12,15 +12,8 @@ .notif-panel { font-size: 20px; - border-radius: 80px; min-height: 37px; min-width: 105px; - padding: 1px 0 1px 5px; - - .toggle-on { - border-radius: 22px 22px 0 0; - border-bottom: 0 solid $bg; - } } .quick-settings-toggle {