diff --git a/nixosModules/ags/v2/widgets/notifs/gesture.tsx b/nixosModules/ags/v2/widgets/notifs/gesture.tsx index 272762d3..49a4dfb2 100644 --- a/nixosModules/ags/v2/widgets/notifs/gesture.tsx +++ b/nixosModules/ags/v2/widgets/notifs/gesture.tsx @@ -1,5 +1,5 @@ import { Gdk, Gtk, Widget } from 'astal/gtk3'; -import { register, property } from 'astal/gobject'; +import { register, signal } from 'astal/gobject'; import { idle, interval } from 'astal'; import AstalIO from 'gi://AstalIO?version=0.1'; @@ -76,11 +76,12 @@ export class NotifGestureWrapper extends Widget.EventBox { private timer_object: AstalIO.Time | undefined; - @property(Number) - declare popup_timer: number; + public popup_timer: number; - @property(Boolean) - declare dragging: boolean; + @signal(Number) + declare timer_update: (popup_timer: number) => void; + + public dragging: boolean; private async get_hovered(): Promise { const layers = JSON.parse(await hyprMessage('j/layers')) as LayerResult; @@ -164,9 +165,11 @@ export class NotifGestureWrapper extends Widget.EventBox { this.id = id; this.slide_in_from = slide_in_from; - this.popup_timer = popup_timer; this.dragging = false; + this.popup_timer = popup_timer; + this.timer_update(this.popup_timer); + // OnClick this.connect('button-press-event', () => { if (!display) { @@ -219,7 +222,7 @@ export class NotifGestureWrapper extends Widget.EventBox { this.slideAway('Left'); } else { - this.popup_timer--; + this.timer_update(--this.popup_timer); } } }); diff --git a/nixosModules/ags/v2/widgets/notifs/notification.tsx b/nixosModules/ags/v2/widgets/notifs/notification.tsx index db964993..f53f92d9 100644 --- a/nixosModules/ags/v2/widgets/notifs/notification.tsx +++ b/nixosModules/ags/v2/widgets/notifs/notification.tsx @@ -115,7 +115,7 @@ export const Notification = ({ id={id} popup_timer={popup_timer} setup_notif={(self) => { - self.connect('notify::popup-timer', () => { + self.connect('timer-update', () => { progress.fraction = self.popup_timer / 5; }); }}