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

This commit is contained in:
Michael Natterer 2010-10-31 20:03:55 +01:00 committed by Tristan Van Berkom
parent 8979855f60
commit 8dd7023b52

View File

@ -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;