scale: always add marks at the beginning or the end

Marks are always either the first or the last child of the scale.
This commit is contained in:
Cosimo Cecchi 2016-02-24 12:24:41 -08:00
parent 1d047f0097
commit a9ea544f3d
3 changed files with 2 additions and 9 deletions

View File

@ -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)
{

View File

@ -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

View File

@ -1650,7 +1650,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));
@ -1665,7 +1665,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);