views/month-view-row: Add method for focusing adjacent cells
This method allows to focus the month cells behind the event widgets. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/564>
This commit is contained in:
@@ -1273,3 +1273,20 @@ gcal_month_view_row_update_selection (GcalMonthViewRow *self,
|
||||
gcal_month_cell_set_selected (month_cell, selected);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gcal_month_view_row_focus_adjacent_cell (GcalMonthViewRow *self,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *cell;
|
||||
g_autoptr (FocusEventData) data = NULL;
|
||||
|
||||
g_assert (GCAL_IS_MONTH_VIEW_ROW (self));
|
||||
g_assert (gtk_widget_is_ancestor (widget, GTK_WIDGET (self)));
|
||||
|
||||
data = create_focus_event_data (self, widget);
|
||||
|
||||
cell = gcal_month_view_row_get_cell_at_x (self, data->focal_x);
|
||||
|
||||
return gtk_widget_grab_focus (cell);
|
||||
}
|
||||
|
||||
@@ -59,4 +59,7 @@ GtkWidget* gcal_month_view_row_get_cell_at_x (GcalMonthViewR
|
||||
|
||||
void gcal_month_view_row_update_selection (GcalMonthViewRow *self,
|
||||
GcalRange *selection_range);
|
||||
|
||||
gboolean gcal_month_view_row_focus_adjacent_cell (GcalMonthViewRow *self,
|
||||
GtkWidget *widget);
|
||||
G_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user