summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-04-22 13:49:27 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-04-22 13:49:27 +0000
commit171d43b2069ba9f39bd37e6329c56c8ce2ce3cc7 (patch)
tree3f7187ef329cf5ea7d42e047a43c58efc1768497 /gtk/gtkspinbutton.c
parenta92c54108ed0a3c21e44c855ad2d46f5a77a351d (diff)
downloadgtk+-171d43b2069ba9f39bd37e6329c56c8ce2ce3cc7.tar.gz
Make spinbuttons work with negative increments. (#137975, Tim Gerla)
2004-04-22 Matthias Clasen <mclasen@redhat.com> * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons work with negative increments. (#137975, Tim Gerla)
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 1c4c30924b..2a062115b8 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -823,14 +823,21 @@ static gboolean
spin_button_at_limit (GtkSpinButton *spin_button,
GtkArrowType arrow)
{
+ GtkArrowType effective_arrow;
+
if (spin_button->wrap)
return FALSE;
- if (arrow == GTK_ARROW_UP &&
+ if (spin_button->adjustment->step_increment > 0)
+ effective_arrow = arrow;
+ else
+ effective_arrow = arrow == GTK_ARROW_UP ? GTK_ARROW_DOWN : GTK_ARROW_UP;
+
+ if (effective_arrow == GTK_ARROW_UP &&
(spin_button->adjustment->upper - spin_button->adjustment->value <= EPSILON))
return TRUE;
- if (arrow == GTK_ARROW_DOWN &&
+ if (effective_arrow == GTK_ARROW_DOWN &&
(spin_button->adjustment->value - spin_button->adjustment->lower <= EPSILON))
return TRUE;