Merge branch 'wip/p3732/no-additional-grid-tile' into 'main'

grid-view: make footer tile file empty space

Closes #6076

See merge request GNOME/gtk!6370
This commit is contained in:
Benjamin Otte 2024-04-13 15:35:43 +00:00
commit afe61e28e0

View File

@ -743,7 +743,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
int baseline)
{
GtkGridView *self = GTK_GRID_VIEW (widget);
GtkListTile *tile, *start;
GtkListTile *tile, *start, *footer;
GArray *heights;
int min_row_height, unknown_row_height, row_height, col_min, col_nat;
GtkOrientation orientation;
@ -880,11 +880,11 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
i = 0;
}
}
/* Add a filler tile for empty space in the bottom right */
footer = gtk_list_item_manager_get_last (self->item_manager);
g_assert (gtk_list_tile_is_footer (footer));
/* Make the footer tile fill the empty space in the bottom right */
if (i > 0)
{
GtkListTile *footer = gtk_list_item_manager_get_last (self->item_manager);
g_assert (gtk_list_tile_is_footer (footer));
tile = gtk_rb_tree_node_get_previous (footer);
gtk_list_tile_set_area_position (self->item_manager,
footer,
@ -895,8 +895,15 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
column_end (self, xspacing, self->n_columns - 1) - footer->area.x,
tile->area.height);
}
else
{
gtk_list_tile_set_area_size (self->item_manager,
footer,
0,
0);
}
/* step 4: allocate the rest */
/* step 5: allocate the rest */
gtk_list_base_allocate (GTK_LIST_BASE (self));
}