Merge branch 'empty_list_adjustment' into 'main'

listviews: Reset scrollbar adjustment when list is empty

Closes #4370

See merge request GNOME/gtk!4865
This commit is contained in:
Matthias Clasen 2022-07-13 11:17:07 +00:00
commit 24f31b6797
2 changed files with 8 additions and 2 deletions

View File

@ -758,7 +758,10 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
/* step 0: exit early if list is empty */
if (gtk_list_item_manager_get_root (self->item_manager) == NULL)
return;
{
gtk_list_base_update_adjustments (GTK_LIST_BASE (self), 0, 0, 0, 0, &x, &y);
return;
}
/* step 1: determine width of the list */
gtk_grid_view_measure_column_size (self, &col_min, &col_nat);

View File

@ -596,7 +596,10 @@ gtk_list_view_size_allocate (GtkWidget *widget,
/* step 0: exit early if list is empty */
if (gtk_list_item_manager_get_root (self->item_manager) == NULL)
return;
{
gtk_list_base_update_adjustments (GTK_LIST_BASE (self), 0, 0, 0, 0, &x, &y);
return;
}
/* step 1: determine width of the list */
gtk_widget_measure (widget, opposite_orientation,