gtkspinbutton: Respect value of inherited 'editable' property

When this property is set to 'FALSE', user's click on the buttons
should not actually update the value but rather result in error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
This commit is contained in:
Zeeshan Ali (Khattak) 2012-01-04 00:44:24 +02:00
parent 022c576bd2
commit 3caa370bb5

View File

@ -1348,7 +1348,7 @@ gtk_spin_button_button_press (GtkWidget *widget,
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);
priv->button = event->button; priv->button = event->button;
if (gtk_editable_get_editable (GTK_EDITABLE (widget))) if (gtk_editable_get_editable (GTK_EDITABLE (widget))) {
gtk_spin_button_update (spin); gtk_spin_button_update (spin);
if (event->button == 1) if (event->button == 1)
@ -1357,6 +1357,8 @@ gtk_spin_button_button_press (GtkWidget *widget,
start_spinning (spin, event->window, gtk_adjustment_get_page_increment (priv->adjustment)); start_spinning (spin, event->window, gtk_adjustment_get_page_increment (priv->adjustment));
else else
priv->click_child = event->window; priv->click_child = event->window;
} else
gtk_widget_error_bell (widget);
return TRUE; return TRUE;
} }