Commit 9cf225c9 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

improved the calculation of the minimum size of the entry.

2007-10-17  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppropwidgets.c (gimp_prop_size_entry_new):
	improved the calculation of the minimum size of the entry.

svn path=/trunk/; revision=23856
parent 5e9914ec
2007-10-17 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppropwidgets.c (gimp_prop_size_entry_new):
improved the calculation of the minimum size of the entry.
2007-10-17 Sven Neumann <sven@gimp.org> 2007-10-17 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppropwidgets.c: formatting. * libgimpwidgets/gimppropwidgets.c: formatting.
...@@ -2639,6 +2639,7 @@ gimp_prop_size_entry_new (GObject *config, ...@@ -2639,6 +2639,7 @@ gimp_prop_size_entry_new (GObject *config,
gdouble value; gdouble value;
gdouble lower; gdouble lower;
gdouble upper; gdouble upper;
gint characters;
GimpUnit unit_value; GimpUnit unit_value;
param_spec = find_param_spec (config, property_name, G_STRFUNC); param_spec = find_param_spec (config, property_name, G_STRFUNC);
...@@ -2682,10 +2683,14 @@ gimp_prop_size_entry_new (GObject *config, ...@@ -2682,10 +2683,14 @@ gimp_prop_size_entry_new (GObject *config,
show_percent = FALSE; show_percent = FALSE;
} }
characters = log (MAX (fabs (lower), fabs (upper))) / log (10);
if (lower < 0.0)
characters += 1;
entry = gimp_size_entry_new (1, unit_value, unit_format, entry = gimp_size_entry_new (1, unit_value, unit_format,
show_pixels, show_percent, FALSE, show_pixels, show_percent, FALSE,
ceil (log (upper) / log (10) + 2), characters, update_policy);
update_policy);
gtk_table_set_col_spacing (GTK_TABLE (entry), 1, 4); gtk_table_set_col_spacing (GTK_TABLE (entry), 1, 4);
set_param_spec (NULL, set_param_spec (NULL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment