summaryrefslogtreecommitdiff
path: root/src/modules/popdowns/notifications.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-02 15:06:27 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-02 15:06:27 +1100
commite9eba2e2914e6c9aa01dd3d6267c969bcba3bb2f (patch)
tree9ce2fad274d4978d9531b5c57c2ceb4d67c219b5 /src/modules/popdowns/notifications.tsx
parentsidebar: add date time to time pane (diff)
downloadcaelestia-shell-e9eba2e2914e6c9aa01dd3d6267c969bcba3bb2f.tar.gz
caelestia-shell-e9eba2e2914e6c9aa01dd3d6267c969bcba3bb2f.tar.bz2
caelestia-shell-e9eba2e2914e6c9aa01dd3d6267c969bcba3bb2f.zip
cleanup: remove popdown stuff
Popdowns were replaced with the sidebar
Diffstat (limited to 'src/modules/popdowns/notifications.tsx')
-rw-r--r--src/modules/popdowns/notifications.tsx65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/modules/popdowns/notifications.tsx b/src/modules/popdowns/notifications.tsx
deleted file mode 100644
index 4ab0095..0000000
--- a/src/modules/popdowns/notifications.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { bind } from "astal";
-import { Astal, Gtk } from "astal/gtk3";
-import AstalNotifd from "gi://AstalNotifd";
-import Notification from "../../widgets/notification";
-import PopdownWindow from "../../widgets/popdownwindow";
-
-const List = () => (
- <box
- vertical
- valign={Gtk.Align.START}
- className="list"
- setup={self => {
- const notifd = AstalNotifd.get_default();
- const map = new Map<number, Notification>();
-
- const addNotification = (notification: AstalNotifd.Notification) => {
- const notif = (<Notification notification={notification} />) as Notification;
- notif.connect("destroy", () => map.get(notification.id) === notif && map.delete(notification.id));
- map.get(notification.id)?.destroyWithAnims();
- map.set(notification.id, notif);
-
- self.pack_end(
- <eventbox
- // Dismiss on middle click
- onClick={(_, event) => event.button === Astal.MouseButton.MIDDLE && notification.dismiss()}
- >
- {notif}
- </eventbox>,
- false,
- false,
- 0
- );
- };
-
- notifd
- .get_notifications()
- .sort((a, b) => a.time - b.time)
- .forEach(addNotification);
-
- self.hook(notifd, "notified", (_, id) => addNotification(notifd.get_notification(id)));
- self.hook(notifd, "resolved", (_, id) => map.get(id)?.destroyWithAnims());
- }}
- />
-);
-
-export default () => (
- <PopdownWindow
- name="notifications"
- count={bind(AstalNotifd.get_default(), "notifications").as(n => n.length)}
- headerButtons={[
- {
- label: "Silence",
- onClicked: () => (AstalNotifd.get_default().dontDisturb = !AstalNotifd.get_default().dontDisturb),
- enabled: bind(AstalNotifd.get_default(), "dontDisturb"),
- },
- {
- label: "Clear",
- onClicked: () => AstalNotifd.get_default().notifications.forEach(n => n.dismiss()),
- },
- ]}
- emptyIcon="notifications_active"
- emptyLabel="All caught up!"
- list={<List />}
- />
-);