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)
This commit is contained in:
Matthias Clasen 2004-04-22 13:49:27 +00:00 committed by Matthias Clasen
parent a92c54108e
commit 171d43b206
6 changed files with 34 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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