fix(wim ags): fix notif button

This commit is contained in:
matt1432 2023-11-27 15:15:02 -05:00
parent f85df15e93
commit d8881b9eca
2 changed files with 28 additions and 30 deletions

View file

@ -1,9 +1,12 @@
import App from 'resource:///com/github/Aylur/ags/app.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.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 EventBox from '../../misc/cursorbox.js';
import Separator from '../../misc/separator.js';
const SPACING = 4;
export default () => EventBox({ export default () => EventBox({
@ -17,30 +20,32 @@ export default () => EventBox({
} }
}]], }]],
child: Box({ child: CenterBox({
className: 'notif-panel', className: 'notif-panel',
vertical: false,
children: [ center_widget: Box({
Icon({ children: [
hpack: 'center', Icon({
connections: [[Notifications, (self) => { connections: [[Notifications, (self) => {
if (Notifications.dnd) { if (Notifications.dnd) {
self.icon = 'notification-disabled-symbolic'; self.icon = 'notification-disabled-symbolic';
} }
else if (Notifications.notifications.length > 0) { else if (Notifications.notifications.length > 0) {
self.icon = 'notification-new-symbolic'; self.icon = 'notification-new-symbolic';
} }
else { else {
self.icon = 'notification-symbolic'; self.icon = 'notification-symbolic';
} }
}]], }]],
}), }),
Label({
binds: [['label', Notifications, 'notifications',
(n) => String(n.length)]],
}),
], Separator(SPACING),
Label({
binds: [['label', Notifications, 'notifications',
(n) => String(n.length)]],
}),
],
}),
}), }),
}); });

View file

@ -12,15 +12,8 @@
.notif-panel { .notif-panel {
font-size: 20px; font-size: 20px;
border-radius: 80px;
min-height: 37px; min-height: 37px;
min-width: 105px; min-width: 105px;
padding: 1px 0 1px 5px;
.toggle-on {
border-radius: 22px 22px 0 0;
border-bottom: 0 solid $bg;
}
} }
.quick-settings-toggle { .quick-settings-toggle {