GtkScaleButton: Set +/- sensitivity

The buttons should go insensitive when we are at their end of
the scale.
This commit is contained in:
Matthias Clasen 2014-07-08 10:27:30 -04:00
parent 73bc9b59dd
commit 0a34633914

View File

@ -1040,11 +1040,17 @@ cb_scale_value_changed (GtkRange *range,
{
GtkScaleButton *button = user_data;
gdouble value;
gdouble upper, lower;
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_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_object_notify (G_OBJECT (button), "value");
}