[gtk+/gtk-3-20] scale: fix marks node position for scales with value



commit 5d83553beb6ffb2c56bf02ce460b239b83468cfc
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Mar 26 22:36:12 2016 -0700

    scale: fix marks node position for scales with value
    
    We should only count the value node as the first/last one if its
    position matches.

 gtk/gtkscale.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 17a2e8b..a9a6fe2 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -2075,7 +2075,9 @@ gtk_scale_add_mark (GtkScale        *scale,
                                        NULL, NULL);
           gtk_css_node_insert_after (widget_node,
                                      gtk_css_gadget_get_node (priv->top_marks_gadget),
-                                     priv->value_gadget ? gtk_css_gadget_get_node (priv->value_gadget) : 
NULL);
+                                     (priv->value_gadget &&
+                                      (priv->value_pos == GTK_POS_TOP || priv->value_pos == GTK_POS_LEFT)) ?
+                                     gtk_css_gadget_get_node (priv->value_gadget) : NULL);
           gtk_css_gadget_add_class (priv->top_marks_gadget, GTK_STYLE_CLASS_TOP);
           gtk_css_gadget_set_state (priv->top_marks_gadget, gtk_css_node_get_state (widget_node));
         }
@@ -2094,7 +2096,9 @@ gtk_scale_add_mark (GtkScale        *scale,
                                        NULL, NULL);
           gtk_css_node_insert_before (widget_node,
                                       gtk_css_gadget_get_node (priv->bottom_marks_gadget),
-                                      priv->value_gadget ? gtk_css_gadget_get_node (priv->value_gadget) : 
NULL);
+                                      (priv->value_gadget &&
+                                       (priv->value_pos == GTK_POS_BOTTOM || priv->value_pos == 
GTK_POS_RIGHT)) ?
+                                      gtk_css_gadget_get_node (priv->value_gadget) : NULL);
           gtk_css_gadget_add_class (priv->bottom_marks_gadget, GTK_STYLE_CLASS_BOTTOM);
           gtk_css_gadget_set_state (priv->bottom_marks_gadget, gtk_css_node_get_state (widget_node));
         }


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