meeting-row: Implement grab_focus()
We'll use this in the next commit to properly grab focus of the first meeting row, if any.
This commit is contained in:
@@ -29,6 +29,8 @@ struct _GcalMeetingRow
|
|||||||
{
|
{
|
||||||
AdwActionRow parent_instance;
|
AdwActionRow parent_instance;
|
||||||
|
|
||||||
|
GtkWidget *join_button;
|
||||||
|
|
||||||
gchar *url;
|
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
|
* GObject overrides
|
||||||
*/
|
*/
|
||||||
@@ -167,6 +180,8 @@ gcal_meeting_row_class_init (GcalMeetingRowClass *klass)
|
|||||||
object_class->get_property = gcal_meeting_row_get_property;
|
object_class->get_property = gcal_meeting_row_get_property;
|
||||||
object_class->set_property = gcal_meeting_row_set_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",
|
signals[JOIN_MEETING] = g_signal_new ("join-meeting",
|
||||||
GCAL_TYPE_MEETING_ROW,
|
GCAL_TYPE_MEETING_ROW,
|
||||||
G_SIGNAL_RUN_LAST,
|
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_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_bind_template_callback (widget_class, on_join_button_clicked_cb);
|
||||||
|
|
||||||
gtk_widget_class_set_css_name (widget_class, "meetingrow");
|
gtk_widget_class_set_css_name (widget_class, "meetingrow");
|
||||||
|
|||||||
Reference in New Issue
Block a user