diff options
author | Benjamin Otte <otte@redhat.com> | 2016-03-09 17:27:01 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-03-11 16:39:34 +0100 |
commit | fc7335bdb4c1bed38b7287354d348af949c20ace (patch) | |
tree | 4917beb344694fbf137990738fab8437759c0edc /gtk/gtkrange.c | |
parent | 8351a6e4d61a48921582668dd54b3094cbcd75ac (diff) | |
download | gtk+-fc7335bdb4c1bed38b7287354d348af949c20ace.tar.gz |
colorscale: Draw a trough
Make sure the color info is actually drawn inside the trough.
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r-- | gtk/gtkrange.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 50357c2cb6..9b78108934 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2355,6 +2355,12 @@ gtk_range_render_trough (GtkCssGadget *gadget, GtkRange *range = GTK_RANGE (widget); GtkRangePrivate *priv = range->priv; + /* HACK: GtkColorScale wants to draw its own trough + * so we let it... + */ + if (GTK_IS_COLOR_SCALE (widget)) + gtk_color_scale_draw_trough (GTK_COLOR_SCALE (widget), cr, x, y, width, height); + if (priv->show_fill_level && gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) @@ -2379,11 +2385,7 @@ gtk_range_render (GtkCssGadget *gadget, GtkRange *range = GTK_RANGE (widget); GtkRangePrivate *priv = range->priv; - /* HACK: we can't render the contents box directly because - * GtkColorScale wants to omit the trough but still draw the slider... - */ - if (!GTK_IS_COLOR_SCALE (widget)) - gtk_css_gadget_draw (priv->contents_gadget, cr); + gtk_css_gadget_draw (priv->contents_gadget, cr); /* Draw the slider last, so that e.g. the focus ring stays below it */ gtk_css_gadget_draw (priv->slider_gadget, cr); |