HyprPanel now handles notification removal itself. (#242)

This commit is contained in:
Jas Singh
2024-09-09 23:03:01 -07:00
committed by GitHub
parent bb3b3dfdfb
commit 4721b4fbf9
7 changed files with 125 additions and 76 deletions

View File

@@ -1,3 +1,4 @@
import { closeNotifications } from "globals/notification";
import { Notifications } from "types/service/notifications";
const Controls = (notifs: Notifications) => {
@@ -40,11 +41,21 @@ const Controls = (notifs: Notifications) => {
class_name: "menu-separator notification-controls",
}),
Widget.Button({
class_name: "clear-notifications-button",
className: "clear-notifications-button",
tooltip_text: "Clear Notifications",
on_primary_click: () => notifs.clear(),
on_primary_click: () => {
if (removingNotifications.value) {
return;
}
closeNotifications(notifs.notifications);
},
child: Widget.Label({
class_name: "clear-notifications-label txt-icon",
class_name: removingNotifications.bind("value").as((removing: boolean) => {
return removing
? "clear-notifications-label txt-icon removing"
: "clear-notifications-label txt-icon";
}),
label: "",
}),
}),