[libgd] GdHeaderBar: Fix size_allocate with hidden children



commit d23d535371d33d32ba2950e443a6be4b508e522a
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Feb 21 19:50:58 2013 +0100

    GdHeaderBar: Fix size_allocate with hidden children
    
    size_allocate was using
       i = g_list_position (priv->children, l);
    to find the index in the size array, but that array
    does not include hidden children.

 libgd/gd-header-bar.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libgd/gd-header-bar.c b/libgd/gd-header-bar.c
index 12f289c..c362ded 100644
--- a/libgd/gd-header-bar.c
+++ b/libgd/gd-header-bar.c
@@ -483,11 +483,15 @@ gd_header_bar_size_allocate (GtkWidget     *widget,
         x = allocation->x + allocation->width - priv->hpadding;
 
       if (packing == GTK_PACK_START)
-        l = priv->children;
+       {
+         l = priv->children;
+         i = 0;
+       }
       else
-        l = g_list_last (priv->children);
-
-      i = g_list_position (priv->children, l);
+       {
+         l = g_list_last (priv->children);
+         i = nvis_children - 1;
+       }
 
       for (l; l != NULL; (packing == GTK_PACK_START) ? (l = l->next) : (l = l->prev))
         {


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