spinbutton: Fix get_text_area_size for vertical spinbuttons
authorBenjamin Otte <otte@redhat.com>
Mon, 16 Mar 2015 14:18:33 +0000 (15:18 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 16 Mar 2015 14:24:16 +0000 (15:24 +0100)
Commit c5905b13b97012fc9e9424718bdce34e0989f512 changed the semantics of
this vfunc and get_entry_size but I only fixed one of them in the
spinbutton subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=746282

gtk/gtkspinbutton.c

index 2d8f98d76ab9ca48122cd4d2ed59732a9630c995..0c69775a04eac4cf4d454278ec51746e944268ac 100644 (file)
@@ -1863,13 +1863,13 @@ gtk_spin_button_get_text_area_size (GtkEntry *entry,
   gint up_panel_width, up_panel_height;
   gint down_panel_width, down_panel_height;
 
-  gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->up_panel, &up_panel_width, &up_panel_height);
-  gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->down_panel, &down_panel_width, &down_panel_height);
-
   GTK_ENTRY_CLASS (gtk_spin_button_parent_class)->get_text_area_size (entry, x, y, width, height);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     {
+      gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->up_panel, &up_panel_width, &up_panel_height);
+      gtk_spin_button_panel_get_size (GTK_SPIN_BUTTON (entry), priv->down_panel, &down_panel_width, &down_panel_height);
+
       if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL)
         {
           if (x)
@@ -1879,14 +1879,6 @@ gtk_spin_button_get_text_area_size (GtkEntry *entry,
       if (width)
         *width -= up_panel_width + down_panel_width;
     }
-  else
-    {
-      if (y)
-        *y += up_panel_height;
-
-      if (height)
-        *height -= up_panel_height + down_panel_height;
-    }
 }
 
 static void