From: Алексей Шилин Date: Thu, 16 Mar 2023 21:21:09 +0000 (+0300) Subject: gridview: Fix condition for adding filler tiles X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~541^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=65b6150e;p=gtk4.git gridview: Fix condition for adding filler tiles Code above ensures that i is always in [0, n_columns - 1] range, so the condition was always true, which resulted in filler tile always being added to the grid. As the result, an empty row appeared at the end of the grid if the number of columns divided the number of items. Only add filler tile if last row is not full, i.e. when i > 0. --- diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c index 41ea645125..76f2e26e00 100644 --- a/gtk/gtkgridview.c +++ b/gtk/gtkgridview.c @@ -820,7 +820,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget, } } /* Add a filler tile for empty space in the bottom right */ - if (i < self->n_columns) + if (i > 0) { GtkListTile *filler; tile = gtk_list_item_manager_get_last (self->item_manager);