From 8548a1dd7fad704fd744f7d0d2301233519de20c Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 13 Jul 2024 10:12:41 -0700 Subject: [PATCH] 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. --- gtk/gtkcolumnview.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c index 4cdeceefb7..a7d746fe80 100644 --- a/gtk/gtkcolumnview.c +++ b/gtk/gtkcolumnview.c @@ -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); }