[gtk+/wip/cosimoc/range-gadget: 20/26] scale: always add marks at the beginning or the end



commit 195093be27c0f0a397ed07dd9401efcd00c375a6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Feb 24 12:24:41 2016 -0800

    scale: always add marks at the beginning or the end
    
    Marks are always either the first or the last child of the scale.

 gtk/gtkrange.c        |    6 ------
 gtk/gtkrangeprivate.h |    1 -
 gtk/gtkscale.c        |    4 ++--
 3 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 40843eb..cebabaf 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3924,12 +3924,6 @@ _gtk_range_set_steppers (GtkRange *range,
   gtk_widget_queue_resize (GTK_WIDGET (range));
 }
 
-GtkCssNode *
-gtk_range_get_trough_node (GtkRange *range)
-{
-  return gtk_css_gadget_get_node (range->priv->trough_gadget);
-}
-
 GtkCssGadget *
 gtk_range_get_slider_gadget (GtkRange *range)
 {
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
index 0b0a875..4376b03 100644
--- a/gtk/gtkrangeprivate.h
+++ b/gtk/gtkrangeprivate.h
@@ -49,7 +49,6 @@ void               _gtk_range_set_steppers                 (GtkRange      *range
                                                             gboolean       has_c,
                                                             gboolean       has_d);
 
-GtkCssNode        *gtk_range_get_trough_node (GtkRange *range);
 GtkCssGadget      *gtk_range_get_slider_gadget (GtkRange *range);
 
 G_END_DECLS
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 970f2b2..6478e60 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1656,7 +1656,7 @@ gtk_scale_add_mark (GtkScale        *scale,
           widget_node = gtk_widget_get_css_node (GTK_WIDGET (scale));
           priv->top_marks_node = gtk_css_node_new ();
           gtk_css_node_set_name (priv->top_marks_node, I_("marks"));
-          gtk_css_node_insert_before (widget_node, priv->top_marks_node, gtk_range_get_trough_node 
(GTK_RANGE (scale)));
+          gtk_css_node_insert_after (widget_node, priv->top_marks_node, NULL);
           gtk_css_node_set_parent (priv->top_marks_node, widget_node);
           gtk_css_node_add_class (priv->top_marks_node, g_quark_from_static_string (GTK_STYLE_CLASS_TOP));
           gtk_css_node_set_state (priv->top_marks_node, gtk_css_node_get_state (widget_node));
@@ -1671,7 +1671,7 @@ gtk_scale_add_mark (GtkScale        *scale,
           widget_node = gtk_widget_get_css_node (GTK_WIDGET (scale));
           priv->bottom_marks_node = gtk_css_node_new ();
           gtk_css_node_set_name (priv->bottom_marks_node, I_("marks"));
-          gtk_css_node_insert_after (widget_node, priv->bottom_marks_node, gtk_range_get_trough_node 
(GTK_RANGE (scale)));
+          gtk_css_node_insert_before (widget_node, priv->bottom_marks_node, NULL);
           gtk_css_node_add_class (priv->bottom_marks_node, g_quark_from_static_string 
(GTK_STYLE_CLASS_BOTTOM));
           gtk_css_node_set_state (priv->bottom_marks_node, gtk_css_node_get_state (widget_node));
           g_object_unref (priv->bottom_marks_node);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]