views/month: Set all non-visible rows as unfocusable

When tabbing into the month view, the keyboard focus would go
to the first week row in the widget hierarchy, rather than the
visible row. Setting the `GtkWidget:can-focus` property to
FALSE on every non-visible row only allows keyboard focus
within the visible rows.
This commit is contained in:
Hari Rana
2025-05-21 01:13:38 -03:00
parent 8c02d0ce24
commit 1ab79d0cc8
+7 -1
View File
@@ -498,7 +498,13 @@ update_row_visuals (GcalMonthView *self)
for (gint i = 0; i < self->week_rows->len; i++)
{
GcalMonthViewRow *row = g_ptr_array_index (self->week_rows, i);
GcalMonthViewRow *row;
gboolean can_focus;
row = g_ptr_array_index (self->week_rows, i);
can_focus = i >= FIRST_VISIBLE_ROW_INDEX && i <= LAST_VISIBLE_ROW_INDEX;
gtk_widget_set_can_focus (GTK_WIDGET (row), can_focus);
gcal_month_view_row_update_style_for_date (row, middle);
}
}