[gtk+/wip/cosimoc/range-gadget: 121/144] range: move GtkColorScale special case to GtkColorScale
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cosimoc/range-gadget: 121/144] range: move GtkColorScale special case to GtkColorScale
- Date: Sat, 27 Feb 2016 21:40:11 +0000 (UTC)
commit d63f3ec1bb81676d770a1de6c20152c93a75dc6f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Feb 22 18:27:52 2016 -0800
range: move GtkColorScale special case to GtkColorScale
Now we can just tweak the node visibility for it.
gtk/gtkcolorscale.c | 5 +++++
gtk/gtkrange.c | 8 +-------
2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 5509c9c..bafcf1b 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -23,6 +23,7 @@
#include "gtkgesturelongpress.h"
#include "gtkcolorutils.h"
#include "gtkorientable.h"
+#include "gtkrangeprivate.h"
#include "gtkstylecontext.h"
#include "gtkaccessible.h"
#include "gtkprivate.h"
@@ -255,6 +256,7 @@ scale_draw (GtkWidget *widget,
static void
gtk_color_scale_init (GtkColorScale *scale)
{
+ GtkCssNode *trough_node;
GtkStyleContext *context;
scale->priv = gtk_color_scale_get_instance_private (scale);
@@ -269,6 +271,9 @@ gtk_color_scale_init (GtkColorScale *scale)
context = gtk_widget_get_style_context (GTK_WIDGET (scale));
gtk_style_context_add_class (context, "color");
+
+ trough_node = gtk_range_get_trough_node (GTK_RANGE (scale));
+ gtk_css_node_set_visible (trough_node, FALSE);
}
static void
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 2591a44..3dcd634 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2268,14 +2268,8 @@ gtk_range_draw (GtkWidget *widget,
{
GtkRange *range = GTK_RANGE (widget);
GtkRangePrivate *priv = range->priv;
- gboolean draw_trough = TRUE;
-
- if (GTK_IS_COLOR_SCALE (widget))
- draw_trough = FALSE;
-
- if (draw_trough)
- gtk_css_gadget_draw (priv->trough_gadget, cr);
+ gtk_css_gadget_draw (priv->trough_gadget, cr);
gtk_css_gadget_draw (priv->slider_gadget, cr);
if (priv->stepper_a_gadget)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]