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: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/659>
This commit is contained in:
@@ -1445,6 +1445,7 @@ gcal_month_view_size_allocate (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkAllocation row_allocation;
|
GtkAllocation row_allocation;
|
||||||
GtkWidget *row;
|
GtkWidget *row;
|
||||||
|
gboolean child_visible;
|
||||||
|
|
||||||
row = g_ptr_array_index (self->week_rows, i);
|
row = g_ptr_array_index (self->week_rows, i);
|
||||||
|
|
||||||
@@ -1457,6 +1458,9 @@ gcal_month_view_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
#undef ROW_Y
|
#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);
|
gtk_widget_size_allocate (row, &row_allocation, baseline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user