Commit Graph

1 Commits

Author SHA1 Message Date
Ell
d928ed7252 libgimpwidgets: add GimpSpinButton
GimpSpinButton is a drop-in replacement for (and a subclass of)
GtkSpinButton.  Unlike GtkSpinButton, it avoids updating the
adjustment value when losing focus, unless the entry text has
changed.  This prevents accidental loss of precision, when the
adjustment value can't be accurately displayed in the entry.

Note that libgimpwidgets already defines a (deprecated)
gimp_spin_button_new() function.  This commit stays compatible with
the old function, by defining GimpSpinButton's _new() function as
gimp_spin_button_new_(), and defining a variadic
gimp_spin_button_new() macro, which expands to either the old or
the new function, based on the number of arguments, so that either
function can be used transparently as gimp_spin_button_new().  This
is all gone in master.
2018-11-10 06:57:54 -05:00