summaryrefslogtreecommitdiff
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
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)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-45
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--gtk/gtkspinbutton.c11
6 files changed, 34 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 846727b6b9..b0aebb9cad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-22 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons
+ work with negative increments. (#137975, Tim Gerla)
+
Wed Apr 21 21:38:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 846727b6b9..b0aebb9cad 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+2004-04-22 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons
+ work with negative increments. (#137975, Tim Gerla)
+
Wed Apr 21 21:38:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 846727b6b9..b0aebb9cad 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,8 @@
+2004-04-22 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons
+ work with negative increments. (#137975, Tim Gerla)
+
Wed Apr 21 21:38:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 846727b6b9..b0aebb9cad 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,8 @@
+2004-04-22 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons
+ work with negative increments. (#137975, Tim Gerla)
+
Wed Apr 21 21:38:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 846727b6b9..b0aebb9cad 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,8 @@
+2004-04-22 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkspinbutton.c (spin_button_at_limit): Make spinbuttons
+ work with negative increments. (#137975, Tim Gerla)
+
Wed Apr 21 21:38:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
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;