From 405f826252aa8a9167f492949534b396c271dfca Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Fri, 6 Feb 2026 09:23:38 -0500 Subject: [PATCH] views/month-view-row: Add method for focusing adjacent cells This method allows to focus the month cells behind the event widgets. Part-of: --- src/gui/views/gcal-month-view-row.c | 17 +++++++++++++++++ src/gui/views/gcal-month-view-row.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/src/gui/views/gcal-month-view-row.c b/src/gui/views/gcal-month-view-row.c index 884b5310..0dbd74d9 100644 --- a/src/gui/views/gcal-month-view-row.c +++ b/src/gui/views/gcal-month-view-row.c @@ -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); +} diff --git a/src/gui/views/gcal-month-view-row.h b/src/gui/views/gcal-month-view-row.h index 25ef503a..44aa6dd5 100644 --- a/src/gui/views/gcal-month-view-row.h +++ b/src/gui/views/gcal-month-view-row.h @@ -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