diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2016-02-27 13:31:26 -0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2016-02-29 10:45:13 -0800 |
commit | 424f17c0fbd6a97132c73a3fb7f3fb374615384d (patch) | |
tree | 7bbf59f26b381eebeefb26446b70a9ab310474e9 /gtk/gtkscrollbar.c | |
parent | 0468ff15459b4e01ca57e4a057908de70e502456 (diff) | |
download | gtk+-424f17c0fbd6a97132c73a3fb7f3fb374615384d.tar.gz |
range: don't use gtk_range_set_min_slider_size()
The way this method is used from the GtkRange subclasses doesn't really
work well when the slider properties change as a consequence of e.g. a
style class being applied (e.g. the fine-tune style class).
In fact, there's no need to read the minimum slider size out of band,
and we can obtain the same result in a way that always work by setting a
private property on GtkRange.
Diffstat (limited to 'gtk/gtkscrollbar.c')
-rw-r--r-- | gtk/gtkscrollbar.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 1656415d83..0f4ca11291 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -152,17 +152,10 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) static void gtk_scrollbar_update_style (GtkScrollbar *scrollbar) { - gint slider_length; gboolean fixed_size; gboolean has_a, has_b, has_c, has_d; GtkRange *range = GTK_RANGE (scrollbar); GtkWidget *widget = GTK_WIDGET (scrollbar); - GtkCssGadget *slider_gadget = gtk_range_get_slider_gadget (range); - - gtk_css_gadget_get_preferred_size (slider_gadget, - gtk_orientable_get_orientation (GTK_ORIENTABLE (scrollbar)), -1, - &slider_length, NULL, - NULL, NULL); gtk_widget_style_get (widget, "fixed-slider-length", &fixed_size, @@ -172,7 +165,6 @@ gtk_scrollbar_update_style (GtkScrollbar *scrollbar) "has-forward-stepper", &has_d, NULL); - gtk_range_set_min_slider_size (range, slider_length); gtk_range_set_slider_size_fixed (range, fixed_size); _gtk_range_set_steppers (range, has_a, has_b, has_c, has_d); } @@ -181,6 +173,7 @@ static void gtk_scrollbar_init (GtkScrollbar *scrollbar) { gtk_scrollbar_update_style (scrollbar); + gtk_range_set_slider_use_min_size (GTK_RANGE (scrollbar), TRUE); } static void |