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.
This commit is contained in:
Cosimo Cecchi 2016-03-26 22:36:12 -07:00
parent 9f48b6b07a
commit 26f9dc6508

View File

@ -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));
}