summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2023-03-17 23:54:01 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2023-03-17 23:54:01 -0300
commit6df87fb5c13953a2ee2527f1ebff7a3c1444021c (patch)
tree5260cc0f92cfe8ab61e9d166683180191e3a51a9
parent5e1ffbcbf6c2724edb06b91bc0477cd309731b49 (diff)
downloadgnome-calendar-6df87fb5c13953a2ee2527f1ebff7a3c1444021c.tar.gz
meeting-row: Implement grab_focus()
We'll use this in the next commit to properly grab focus of the first meeting row, if any.
-rw-r--r--src/gui/gcal-meeting-row.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/gcal-meeting-row.c b/src/gui/gcal-meeting-row.c
index 26fbf496..ef2d78dd 100644
--- a/src/gui/gcal-meeting-row.c
+++ b/src/gui/gcal-meeting-row.c
@@ -29,6 +29,8 @@ struct _GcalMeetingRow
{
AdwActionRow parent_instance;
+ GtkWidget *join_button;
+
gchar *url;
};
@@ -103,6 +105,17 @@ on_join_button_clicked_cb (GtkButton *button,
}
+static gboolean
+gcal_meeting_row_grab_focus (GtkWidget *widget)
+{
+ GcalMeetingRow *self = (GcalMeetingRow *) widget;
+
+ gtk_widget_grab_focus (self->join_button);
+
+ return TRUE;
+}
+
+
/*
* GObject overrides
*/
@@ -167,6 +180,8 @@ gcal_meeting_row_class_init (GcalMeetingRowClass *klass)
object_class->get_property = gcal_meeting_row_get_property;
object_class->set_property = gcal_meeting_row_set_property;
+ widget_class->grab_focus = gcal_meeting_row_grab_focus;
+
signals[JOIN_MEETING] = g_signal_new ("join-meeting",
GCAL_TYPE_MEETING_ROW,
G_SIGNAL_RUN_LAST,
@@ -185,6 +200,8 @@ gcal_meeting_row_class_init (GcalMeetingRowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/gui/gcal-meeting-row.ui");
+ gtk_widget_class_bind_template_child (widget_class, GcalMeetingRow, join_button);
+
gtk_widget_class_bind_template_callback (widget_class, on_join_button_clicked_cb);
gtk_widget_class_set_css_name (widget_class, "meetingrow");