diff options
author | Matthias Clasen <maclas@gmx.de> | 2003-03-29 00:11:32 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-03-29 00:11:32 +0000 |
commit | feefa270e3c422ae8b28b1b263cd1a2e83b5dc1d (patch) | |
tree | fa7c9b01755c37921d273fc9d911f7aabd2569ce /gtk/gtkspinbutton.c | |
parent | 357833d9a350115988650e97ae6911902f5e427c (diff) | |
download | gtk+-feefa270e3c422ae8b28b1b263cd1a2e83b5dc1d.tar.gz |
Fixes for bug #56248:
2003-03-29 Matthias Clasen <maclas@gmx.de>
Fixes for bug #56248:
* gtk/gtknotebook.c (stop_scrolling): New function to remove the
timer and queue a redraw.
(gtk_notebook_grab_notify):
(gtk_notebook_state_changed): New functions to call stop_scrolling()
if necessary.
(gtk_notebook_button_release): Use stop_scrolling().
(gtk_notebook_draw_arrow): Fix drawing of insensitive arrows.
* gtk/gtkrange.c (stop_scrolling): New function to remove the
grab, remove the timer and queue a redraw.
(gtk_range_grab_notify):
(gtk_range_state_changed): New functions to call stop_scrolling()
if necessary.
(gtk_range_button_release): Use stop_scrolling().
* gtk/gtkspinbutton.c (gtk_spin_button_grab_notify):
(gtk_spin_button_state_changed): Redraw after stop_spinning.
(gtk_spin_button_stop_spinning): Reset click_child to correct the
drawing of the arrows.
(gtk_spin_button_button_release): Use a local copy of click_child,
since stop_spinning() resets it.
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r-- | gtk/gtkspinbutton.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 654f73f5ec..a2aa1352b4 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -955,16 +955,26 @@ static void gtk_spin_button_grab_notify (GtkWidget *widget, gboolean was_grabbed) { + GtkSpinButton *spin = GTK_SPIN_BUTTON (widget); + if (!was_grabbed) - gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget)); + { + gtk_spin_button_stop_spinning (spin); + spin_button_redraw (spin); + } } static void gtk_spin_button_state_changed (GtkWidget *widget, GtkStateType previous_state) { + GtkSpinButton *spin = GTK_SPIN_BUTTON (widget); + if (!GTK_WIDGET_IS_SENSITIVE (widget)) - gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget)); + { + gtk_spin_button_stop_spinning (spin); + spin_button_redraw (spin); + } } static gint @@ -1006,6 +1016,9 @@ gtk_spin_button_stop_spinning (GtkSpinButton *spin) spin->timer = 0; spin->timer_step = spin->adjustment->step_increment; spin->timer_calls = 0; + + spin->click_child = NO_ARROW; + spin->button = 0; } static void @@ -1084,7 +1097,7 @@ gtk_spin_button_button_release (GtkWidget *widget, if (event->button == spin->button) { - guint click_child; + int click_child = spin->click_child; gtk_spin_button_stop_spinning (spin); @@ -1094,7 +1107,7 @@ gtk_spin_button_button_release (GtkWidget *widget, event->y <= widget->requisition.height && event->x <= arrow_size + 2 * widget->style->xthickness) { - if (spin->click_child == GTK_ARROW_UP && + if (click_child == GTK_ARROW_UP && event->y <= widget->requisition.height / 2) { gdouble diff; @@ -1103,7 +1116,7 @@ gtk_spin_button_button_release (GtkWidget *widget, if (diff > EPSILON) gtk_spin_button_real_spin (spin, diff); } - else if (spin->click_child == GTK_ARROW_DOWN && + else if (click_child == GTK_ARROW_DOWN && event->y > widget->requisition.height / 2) { gdouble diff; @@ -1114,9 +1127,6 @@ gtk_spin_button_button_release (GtkWidget *widget, } } } - click_child = spin->click_child; - spin->click_child = NO_ARROW; - spin->button = 0; spin_button_redraw (spin); return TRUE; |