fix(wim ags): fix notif button
This commit is contained in:
parent
f85df15e93
commit
d8881b9eca
2 changed files with 28 additions and 30 deletions
|
@ -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)]],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue