summaryrefslogtreecommitdiff
path: root/gtk/gtkgridview.c
diff options
context:
space:
mode:
authorАлексей Шилин <a.i.shilin@yandex.ru>2023-03-17 00:21:09 +0300
committerАлексей Шилин <a.i.shilin@yandex.ru>2023-03-17 00:21:09 +0300
commit65b6150e787a5ba278dd2ef5bccee97b0049af37 (patch)
tree3ec58515f958bdd8a47a23be60d36aa8e0a5ca35 /gtk/gtkgridview.c
parentcf332e2efac6ad7acef72eef84221081c7d7aa17 (diff)
downloadgtk+-65b6150e787a5ba278dd2ef5bccee97b0049af37.tar.gz
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.
Diffstat (limited to 'gtk/gtkgridview.c')
-rw-r--r--gtk/gtkgridview.c2
1 files changed, 1 insertions, 1 deletions
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);