forked from AuroraMiddleware/gtk
GtkScaleButton: Set +/- sensitivity
The buttons should go insensitive when we are at their end of the scale.
This commit is contained in:
parent
73bc9b59dd
commit
0a34633914
@ -1040,11 +1040,17 @@ cb_scale_value_changed (GtkRange *range,
|
|||||||
{
|
{
|
||||||
GtkScaleButton *button = user_data;
|
GtkScaleButton *button = user_data;
|
||||||
gdouble value;
|
gdouble value;
|
||||||
|
gdouble upper, lower;
|
||||||
|
|
||||||
value = gtk_range_get_value (range);
|
value = gtk_range_get_value (range);
|
||||||
|
upper = gtk_adjustment_get_upper (button->priv->adjustment);
|
||||||
|
lower = gtk_adjustment_get_lower (button->priv->adjustment);
|
||||||
|
|
||||||
gtk_scale_button_update_icon (button);
|
gtk_scale_button_update_icon (button);
|
||||||
|
|
||||||
|
gtk_widget_set_sensitive (button->priv->plus_button, value < upper);
|
||||||
|
gtk_widget_set_sensitive (button->priv->minus_button, lower < value);
|
||||||
|
|
||||||
g_signal_emit (button, signals[VALUE_CHANGED], 0, value);
|
g_signal_emit (button, signals[VALUE_CHANGED], 0, value);
|
||||||
g_object_notify (G_OBJECT (button), "value");
|
g_object_notify (G_OBJECT (button), "value");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user