[gtk+/quartz-integration: 60/108] Don't adjust for values that we have previously adjusted for



commit 93ef3d89c720a784d1090b23f9840d73b48f6608
Author: Benjamin Otte <otte redhat com>
Date:   Fri Apr 29 08:59:55 2011 +0200

    Don't adjust for values that we have previously adjusted for
    
    The padding had been taken into account by the computation of
    priv->allocation, so don't compute it twice.

 gtk/gtknotebook.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 2abea22..61e3079 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -6202,6 +6202,27 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
       break;
     }
 
+  if (page != priv->cur_page)
+    {
+      switch (tab_pos)
+        {
+        case GTK_POS_TOP:
+          child_allocation.y -= tab_padding.top;
+          child_allocation.height += tab_padding.top;
+          break;
+        case GTK_POS_BOTTOM:
+          child_allocation.height += tab_padding.bottom;
+          break;
+        case GTK_POS_LEFT:
+          child_allocation.x -= tab_padding.left;
+          child_allocation.width += tab_padding.left;
+          break;
+        case GTK_POS_RIGHT:
+          child_allocation.width += tab_padding.right;
+          break;
+        }
+    }
+
   gtk_widget_get_allocation (page->tab_label, &label_allocation);
   tab_allocation_changed = (child_allocation.x != label_allocation.x ||
                             child_allocation.y != label_allocation.y ||



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