From 084a495f5c0d57849c2426cb64e48be7054ea9bb Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 8 Nov 2025 20:08:56 -0300 Subject: [PATCH] views/month: Hide invisible rows Change the child-visible property of rows when allocating. It's safe to do in allocation because it doesn't affect layout, just rendering. Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/402 Part-of: --- src/gui/views/gcal-month-view.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/views/gcal-month-view.c b/src/gui/views/gcal-month-view.c index f6afb6f2..dd5ea055 100644 --- a/src/gui/views/gcal-month-view.c +++ b/src/gui/views/gcal-month-view.c @@ -1445,6 +1445,7 @@ gcal_month_view_size_allocate (GtkWidget *widget, { GtkAllocation row_allocation; GtkWidget *row; + gboolean child_visible; row = g_ptr_array_index (self->week_rows, i); @@ -1457,6 +1458,9 @@ gcal_month_view_size_allocate (GtkWidget *widget, #undef ROW_Y + child_visible = (row_allocation.y + row_allocation.height > header_height) && row_allocation.y < height; + gtk_widget_set_child_visible (row, child_visible); + gtk_widget_size_allocate (row, &row_allocation, baseline); }