[gtk+/wip/baedert/meson] treeviewcolumn: Don't underallocate column headers



commit e3ff0132b97728913e227d02992c7dbfe88ff63c
Author: Timm Bäder <mail baedert org>
Date:   Sun Sep 25 09:45:55 2016 +0200

    treeviewcolumn: Don't underallocate column headers
    
    Just check the button's min size before allocating it. The treeview
    still won't show the entire button.

 gtk/gtktreeviewcolumn.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 055d938..41d3740 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2115,8 +2115,14 @@ _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
     {
       allocation.x      = x_offset;
       allocation.y      = 0;
-      allocation.width  = width;
-      allocation.height = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view));
+
+      gtk_widget_get_preferred_width (priv->button, &allocation.width, NULL);
+      allocation.width  = MAX (width, allocation.width);
+
+      gtk_widget_get_preferred_height_for_width (priv->button, allocation.width, &allocation.height, NULL);
+
+      allocation.height = MAX (allocation.height,
+                               _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view)));
 
       gtk_widget_size_allocate (priv->button, &allocation);
     }


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