mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 08:00:04 +00:00
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:
parent
022c576bd2
commit
3caa370bb5
@ -1348,15 +1348,17 @@ gtk_spin_button_button_press (GtkWidget *widget,
|
||||
gtk_widget_grab_focus (widget);
|
||||
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);
|
||||
|
||||
if (event->button == 1)
|
||||
start_spinning (spin, event->window, gtk_adjustment_get_step_increment (priv->adjustment));
|
||||
else if (event->button == 2)
|
||||
start_spinning (spin, event->window, gtk_adjustment_get_page_increment (priv->adjustment));
|
||||
else
|
||||
priv->click_child = event->window;
|
||||
if (event->button == 1)
|
||||
start_spinning (spin, event->window, gtk_adjustment_get_step_increment (priv->adjustment));
|
||||
else if (event->button == 2)
|
||||
start_spinning (spin, event->window, gtk_adjustment_get_page_increment (priv->adjustment));
|
||||
else
|
||||
priv->click_child = event->window;
|
||||
} else
|
||||
gtk_widget_error_bell (widget);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user