views/month-popover: Add "closed" signal

This will be needed for setting focus to the last focused widget
after closing the popover.

Alternatively, we could have used the "unmap" signal, but this causes
a significant delay before setting focus to the last focused widget,
as it needs to complete the animation before it emits the
"unmap" signal.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/598>
This commit is contained in:
Hari Rana
2026-03-01 19:35:46 +00:00
committed by Marge Bot
parent f3a6c93245
commit 8877d93059
+10
View File
@@ -61,6 +61,7 @@ enum
enum
{
EVENT_ACTIVATED,
CLOSED,
LAST_SIGNAL,
};
@@ -456,6 +457,13 @@ gcal_month_popover_class_init (GcalMonthPopoverClass *klass)
1,
GCAL_TYPE_EVENT_WIDGET);
signals[CLOSED] = g_signal_new ("closed",
GCAL_TYPE_MONTH_POPOVER,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
0, NULL);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-popover.ui");
gtk_widget_class_bind_template_callback (widget_class, close_button_clicked_cb);
@@ -536,6 +544,8 @@ gcal_month_popover_popdown (GcalMonthPopover *self)
adw_timed_animation_set_easing (ADW_TIMED_ANIMATION (self->animation), ADW_EASE_IN_EXPO);
adw_animation_play (self->animation);
g_signal_emit (self, signals[CLOSED], 0, NULL);
GCAL_EXIT;
}