[gtk/columnview-reordering: 18/22] columnviewlayout: Use header allocation for titles



commit d41fe03b73047d8c775b0b24dbbf294b18682833
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 20 17:28:37 2019 -0500

    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);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]