forked from AuroraMiddleware/gtk
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);
|
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)
|
||||||
start_spinning (spin, event->window, gtk_adjustment_get_step_increment (priv->adjustment));
|
start_spinning (spin, event->window, gtk_adjustment_get_step_increment (priv->adjustment));
|
||||||
else if (event->button == 2)
|
else if (event->button == 2)
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user