colorscale: Redraw correct widget after setting rgba

The entire color scale hack is still done in GtkRange, which draws the
color scale in the range gizmo. So, to correctly redraw the color scale
when setting a new color, we need to redraw the proper widget and that's
the trough widget.

Fixes #1453
This commit is contained in:
Timm Bäder
2019-01-16 19:20:53 +01:00
parent 135cf16969
commit 9b15c6900a
3 changed files with 11 additions and 1 deletions

View File

@@ -289,7 +289,7 @@ gtk_color_scale_set_rgba (GtkColorScale *scale,
GtkColorScalePrivate *priv = gtk_color_scale_get_instance_private (scale);
priv->color = *color;
gtk_widget_queue_draw (GTK_WIDGET (scale));
gtk_widget_queue_draw (gtk_range_get_trough_widget (GTK_RANGE (scale)));
}
GtkWidget *

View File

@@ -2948,6 +2948,14 @@ gtk_range_get_slider_widget (GtkRange *range)
return priv->slider_widget;
}
GtkWidget *
gtk_range_get_trough_widget (GtkRange *range)
{
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
return priv->trough_widget;
}
void
gtk_range_start_autoscroll (GtkRange *range,
GtkScrollType scroll_type)

View File

@@ -42,6 +42,8 @@ gint _gtk_range_get_stop_positions (GtkRange *range
gint **values);
GtkWidget *gtk_range_get_slider_widget (GtkRange *range);
GtkWidget *gtk_range_get_trough_widget (GtkRange *range);
void gtk_range_start_autoscroll (GtkRange *range,
GtkScrollType scroll_type);