columnview: check column visibility when measuring

We only want to measure visible columns so that they may consume the
maximum width available to the widget. This fixes a situation where hidden
columns would cause less-than the whole width to be allocated. Additionally
that fixes warnings where some widgets expect more horizontal space than
they would ultimately be allocated.
This commit is contained in:
Christian Hergert 2024-07-13 10:12:41 -07:00
parent 2ae345aa8f
commit 8548a1dd7f

View File

@ -1845,9 +1845,13 @@ gtk_column_view_measure_across (GtkColumnView *self,
int col_min, col_nat;
column = g_list_model_get_item (G_LIST_MODEL (self->columns), i);
gtk_column_view_column_measure (column, &col_min, &col_nat);
min += col_min;
nat += col_nat;
if (gtk_column_view_column_get_visible (column))
{
gtk_column_view_column_measure (column, &col_min, &col_nat);
min += col_min;
nat += col_nat;
}
g_object_unref (column);
}