[gtk] colorscale: Redraw correct widget after setting rgba
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] colorscale: Redraw correct widget after setting rgba
- Date: Wed, 16 Jan 2019 18:24:34 +0000 (UTC)
commit 9b15c6900a4d3b6bfa89611754317ee7402e9de6
Author: Timm Bäder <mail baedert org>
Date: Wed Jan 16 19:20:53 2019 +0100
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
gtk/gtkcolorscale.c | 2 +-
gtk/gtkrange.c | 8 ++++++++
gtk/gtkrangeprivate.h | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 40cc3e05d3..c5b7d3046a 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -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 *
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index d745e93174..dcd6b95899 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -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)
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
index f76116ea10..40ee468b9c 100644
--- a/gtk/gtkrangeprivate.h
+++ b/gtk/gtkrangeprivate.h
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]