[gtk+/wip/cssvalue: 130/141] paned: Shrinkable widgets don't require a size



commit b0f0963d8d3804539a559e9f01eecea5bad63f98
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 5 11:13:21 2012 +0200

    paned: Shrinkable widgets don't require a size
    
    This could otherwise lead to very funny size request behaviors, in
    particular in empathy.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=587441

 gtk/gtkpaned.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 16c47c1..3c4e082 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -902,7 +902,10 @@ gtk_paned_get_preferred_size (GtkWidget      *widget,
   if (priv->child1 && gtk_widget_get_visible (priv->child1))
     {
       get_preferred_size_for_size (priv->child1, orientation, size, &child_min, &child_nat);
-      *minimum = child_min;
+      if (priv->child1_shrink && priv->orientation == orientation)
+        *minimum = 0;
+      else
+        *minimum = child_min;
       *natural = child_nat;
     }
 
@@ -912,7 +915,8 @@ gtk_paned_get_preferred_size (GtkWidget      *widget,
 
       if (priv->orientation == orientation)
         {
-          *minimum += child_min;
+          if (!priv->child2_shrink)
+            *minimum += child_min;
           *natural += child_nat;
         }
       else



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