2023-10-02 12:06:35 -04:00
|
|
|
import { App, Notifications, Widget } from '../../imports.js';
|
|
|
|
const { Box, Label, Icon } = Widget;
|
2023-09-05 15:10:25 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
import Separator from '../misc/separator.js';
|
|
|
|
import EventBox from '../misc/cursorbox.js';
|
2023-09-10 23:24:58 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => EventBox({
|
2023-09-11 14:38:24 -04:00
|
|
|
className: 'toggle-off',
|
2023-10-14 13:54:45 -04:00
|
|
|
onPrimaryClickRelease: () => App.toggleWindow('notification-center'),
|
2023-10-17 13:47:02 -04:00
|
|
|
connections: [[App, (self, windowName, visible) => {
|
|
|
|
if (windowName == 'notification-center')
|
|
|
|
self.toggleClassName('toggle-on', visible);
|
|
|
|
}]],
|
2023-09-05 15:10:25 -04:00
|
|
|
child: Box({
|
|
|
|
className: 'notif-panel',
|
|
|
|
vertical: false,
|
2023-09-11 14:38:24 -04:00
|
|
|
children: [
|
|
|
|
Separator(28),
|
|
|
|
|
|
|
|
Icon({
|
2023-10-17 13:47:02 -04:00
|
|
|
connections: [[Notifications, self => {
|
|
|
|
if (Notifications.dnd) {
|
|
|
|
self.icon = 'notification-disabled-symbolic'
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (Notifications.notifications.length > 0) {
|
|
|
|
self.icon = 'notification-new-symbolic'
|
2023-09-12 18:00:19 -04:00
|
|
|
}
|
|
|
|
else {
|
2023-10-17 13:47:02 -04:00
|
|
|
self.icon = 'notification-symbolic'
|
2023-09-12 18:00:19 -04:00
|
|
|
}
|
2023-10-17 13:47:02 -04:00
|
|
|
}
|
|
|
|
}]],
|
2023-09-11 14:38:24 -04:00
|
|
|
}),
|
|
|
|
|
|
|
|
Separator(8),
|
|
|
|
|
|
|
|
Label({
|
2023-10-17 13:47:02 -04:00
|
|
|
binds: [
|
|
|
|
['label', Notifications, 'notifications', n => String(n.length)],
|
2023-10-02 12:06:35 -04:00
|
|
|
],
|
2023-09-11 14:38:24 -04:00
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
2023-09-05 15:10:25 -04:00
|
|
|
}),
|
|
|
|
});
|