From c099271bb5b6b6366514977393244e1fa496b534 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 23 Jan 2002 20:15:48 +0000 Subject: [PATCH] Stop spinning if widget becomes insensitive. (#56248) Wed Jan 23 15:12:16 2002 Owen Taylor * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): Stop spinning if widget becomes insensitive. (#56248) --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkspinbutton.c | 11 +++++++++++ 8 files changed, 46 insertions(+) diff --git a/ChangeLog b/ChangeLog index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f47aa7b643..ecb44bc2c1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Wed Jan 23 15:12:16 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): + Stop spinning if widget becomes insensitive. (#56248) + Wed Jan 23 14:44:12 2002 Owen Taylor * gtk/gtkspinbutton.c (EPSILON): Decreate value since diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index ad99dd4d85..12b3ac22b2 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -105,6 +105,8 @@ static gint gtk_spin_button_focus_out (GtkWidget *widget, GdkEventFocus *event); static void gtk_spin_button_grab_notify (GtkWidget *widget, gboolean was_grabbed); +static void gtk_spin_button_state_changed (GtkWidget *widget, + GtkStateType previous_state); static void gtk_spin_button_draw_arrow (GtkSpinButton *spin_button, guint arrow); static gint gtk_spin_button_timer (GtkSpinButton *spin_button); @@ -209,6 +211,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) widget_class->leave_notify_event = gtk_spin_button_leave_notify; widget_class->focus_out_event = gtk_spin_button_focus_out; widget_class->grab_notify = gtk_spin_button_grab_notify; + widget_class->state_changed = gtk_spin_button_state_changed; entry_class->activate = gtk_spin_button_activate; @@ -914,6 +917,14 @@ gtk_spin_button_grab_notify (GtkWidget *widget, gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget)); } +static void +gtk_spin_button_state_changed (GtkWidget *widget, + GtkStateType previous_state) +{ + if (!GTK_WIDGET_IS_SENSITIVE (widget)) + gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget)); +} + static gint gtk_spin_button_scroll (GtkWidget *widget, GdkEventScroll *event)