From 0a3463391406ca95b5c5538c7b777ae7e82effe5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 8 Jul 2014 10:27:30 -0400 Subject: [PATCH] GtkScaleButton: Set +/- sensitivity The buttons should go insensitive when we are at their end of the scale. --- gtk/gtkscalebutton.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 11aee50c6b..b4bda76656 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -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"); }