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:
@@ -61,6 +61,7 @@ enum
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
EVENT_ACTIVATED,
|
EVENT_ACTIVATED,
|
||||||
|
CLOSED,
|
||||||
LAST_SIGNAL,
|
LAST_SIGNAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -456,6 +457,13 @@ gcal_month_popover_class_init (GcalMonthPopoverClass *klass)
|
|||||||
1,
|
1,
|
||||||
GCAL_TYPE_EVENT_WIDGET);
|
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_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);
|
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_timed_animation_set_easing (ADW_TIMED_ANIMATION (self->animation), ADW_EASE_IN_EXPO);
|
||||||
adw_animation_play (self->animation);
|
adw_animation_play (self->animation);
|
||||||
|
|
||||||
|
g_signal_emit (self, signals[CLOSED], 0, NULL);
|
||||||
|
|
||||||
GCAL_EXIT;
|
GCAL_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user