[gtk+] label: Allocate gadget before using it



commit f54e0a283b614aa6b512b0577a0373f380b3f92a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 19 00:33:20 2015 -0500

    label: Allocate gadget before using it
    
    Move the gtk_css_gadget_allocate call before the
    gtk_label_update_layout_width call. This fixes the
    statusbar label in widget-factory page 2 coming
    up fully ellipsized.

 gtk/gtklabel.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 3f41d25..f7e1445 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4084,6 +4084,11 @@ gtk_label_size_allocate (GtkWidget     *widget,
 
   GTK_WIDGET_CLASS (gtk_label_parent_class)->size_allocate (widget, allocation);
 
+  gtk_css_gadget_allocate (priv->gadget,
+                           allocation,
+                           gtk_widget_get_allocated_baseline (widget),
+                           &clip);
+
   if (priv->layout)
     gtk_label_update_layout_width (label);
 
@@ -4094,11 +4099,6 @@ gtk_label_size_allocate (GtkWidget     *widget,
                             allocation->width,
                             allocation->height);
 
-  gtk_css_gadget_allocate (priv->gadget,
-                           allocation,
-                           gtk_widget_get_allocated_baseline (widget),
-                           &clip);
-
   gtk_label_get_ink_rect (label, &clip_rect);
   gdk_rectangle_union (&clip_rect, &clip, &clip_rect);
   _gtk_widget_set_simple_clip (widget, &clip_rect);


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