[gtk+] toolbar: Better fix for animations



commit e54ccaee53dbdf1842bc245a219bce88ef82b28a
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 15 22:50:59 2011 +0200

    toolbar: Better fix for animations
    
    It turns out there's more places where the toolbar item size is used as
    the margin box instead of the content box. Because of that, store the
    margin box when allocating and use it whenever calls
    toolbar_content_get_allocation() instead of calling
    gtk_widget_get_allocation().

 gtk/gtktoolbar.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index da55c6a..6abec0c 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -3253,6 +3253,7 @@ struct _ToolbarContent
   ItemState      state;
 
   GtkToolItem   *item;
+  GtkAllocation  allocation;
   GtkAllocation  start_allocation;
   GtkAllocation  goal_allocation;
   guint          is_placeholder : 1;
@@ -3466,7 +3467,7 @@ static void
 toolbar_content_get_allocation (ToolbarContent *content,
 				GtkAllocation  *allocation)
 {
-  gtk_widget_get_allocation (GTK_WIDGET (content->item), allocation);
+  *allocation = content->allocation;
 }
 
 static void
@@ -3513,20 +3514,9 @@ static void
 toolbar_content_size_allocate (ToolbarContent *content,
 			       GtkAllocation  *allocation)
 {
-  GtkAllocation goal;
-
+  content->allocation = *allocation;
   gtk_widget_size_allocate (GTK_WIDGET (content->item),
                             allocation);
-
-  toolbar_content_get_goal_allocation (content, &goal);
-  if (goal.x == allocation->x && 
-      goal.y == allocation->y && 
-      goal.width == allocation->width && 
-      goal.height == allocation->height)
-    {
-      gtk_widget_get_allocation (GTK_WIDGET (content->item), &goal);
-      toolbar_content_set_goal_allocation (content, &goal);
-    }
 }
 
 static void



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