From 59e49dafd7814ee61f6f5fbebc3e81c235e39b63 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 20 Dec 2019 17:28:37 -0500 Subject: [PATCH] columnviewlayout: Use header allocation for titles Normally, this will be identical to the column allocation, but we will temporarily change it during column reordering. --- gtk/gtkcolumnviewlayout.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gtk/gtkcolumnviewlayout.c b/gtk/gtkcolumnviewlayout.c index c4ba28a112..05f218c525 100644 --- a/gtk/gtkcolumnviewlayout.c +++ b/gtk/gtkcolumnviewlayout.c @@ -118,11 +118,16 @@ gtk_column_view_layout_allocate (GtkLayoutManager *layout_manager, int col_x, col_width; if (GTK_IS_COLUMN_VIEW_CELL (child)) - column = gtk_column_view_cell_get_column (GTK_COLUMN_VIEW_CELL (child)); + { + column = gtk_column_view_cell_get_column (GTK_COLUMN_VIEW_CELL (child)); + gtk_column_view_column_get_allocation (column, &col_x, &col_width); + } else - column = gtk_column_view_title_get_column (GTK_COLUMN_VIEW_TITLE (child)); + { + column = gtk_column_view_title_get_column (GTK_COLUMN_VIEW_TITLE (child)); + gtk_column_view_column_get_header_allocation (column, &col_x, &col_width); + } - gtk_column_view_column_get_allocation (column, &col_x, &col_width); gtk_widget_size_allocate (child, &(GtkAllocation) { col_x, 0, col_width, height }, baseline); } }