From 65b6150e787a5ba278dd2ef5bccee97b0049af37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A8=D0=B8?= =?utf8?q?=D0=BB=D0=B8=D0=BD?= Date: Fri, 17 Mar 2023 00:21:09 +0300 Subject: [PATCH] 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. --- gtk/gtkgridview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2