[gtk+/treeview-refactor] gtk: fix automatic width of spin buttons which have no width in chars set



commit 8dd7023b520482ac5126253c4d46823189b65846
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 31 20:03:55 2010 +0100

    gtk: fix automatic width of spin buttons which have no width in chars set

 gtk/gtkspinbutton.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 023d6b6..e791d79 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -720,18 +720,18 @@ gtk_spin_button_get_preferred_width (GtkWidget *widget,
       string_len = compute_double_length (priv->adjustment->upper,
                                           priv->digits);
       w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
-      *minimum = MAX (*minimum, w);
-      *natural = MAX (*natural, w);
+      width = MAX (width, w);
       string_len = compute_double_length (priv->adjustment->lower, priv->digits);
       w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
-      *minimum = MAX (*minimum, w);
-      *natural = MAX (*natural, w);
+      width = MAX (width, w);
 
       _gtk_entry_get_borders (entry, &xborder, &yborder);
       _gtk_entry_effective_inner_border (entry, &inner_border);
 
-      *minimum += xborder * 2 + inner_border.left + inner_border.right;
-      *natural += xborder * 2 + inner_border.left + inner_border.right;
+      width += xborder * 2 + inner_border.left + inner_border.right;
+
+      *minimum = width;
+      *natural = width;
     }
 
   *minimum += arrow_size + 2 * style->xthickness;



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