forked from AuroraMiddleware/gtk
scale: Stop using style classes for marks
We can use :first/last-child for this now.
This commit is contained in:
parent
fd5729baef
commit
bfee2d3c61
@ -1536,7 +1536,6 @@ void
|
|||||||
gtk_scale_clear_marks (GtkScale *scale)
|
gtk_scale_clear_marks (GtkScale *scale)
|
||||||
{
|
{
|
||||||
GtkScalePrivate *priv;
|
GtkScalePrivate *priv;
|
||||||
GtkStyleContext *context;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_SCALE (scale));
|
g_return_if_fail (GTK_IS_SCALE (scale));
|
||||||
|
|
||||||
@ -1545,10 +1544,6 @@ gtk_scale_clear_marks (GtkScale *scale)
|
|||||||
g_slist_free_full (priv->marks, gtk_scale_mark_free);
|
g_slist_free_full (priv->marks, gtk_scale_mark_free);
|
||||||
priv->marks = NULL;
|
priv->marks = NULL;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (GTK_WIDGET (scale));
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
|
||||||
|
|
||||||
if (priv->top_marks_node)
|
if (priv->top_marks_node)
|
||||||
{
|
{
|
||||||
gtk_css_node_set_parent (priv->top_marks_node, NULL);
|
gtk_css_node_set_parent (priv->top_marks_node, NULL);
|
||||||
@ -1600,7 +1595,6 @@ gtk_scale_add_mark (GtkScale *scale,
|
|||||||
GSList *m;
|
GSList *m;
|
||||||
gdouble *values;
|
gdouble *values;
|
||||||
gint n, i;
|
gint n, i;
|
||||||
GtkStyleContext *context;
|
|
||||||
GtkCssNode *widget_node, *marks_node;
|
GtkCssNode *widget_node, *marks_node;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_SCALE (scale));
|
g_return_if_fail (GTK_IS_SCALE (scale));
|
||||||
@ -1688,20 +1682,6 @@ gtk_scale_add_mark (GtkScale *scale,
|
|||||||
|
|
||||||
g_free (values);
|
g_free (values);
|
||||||
|
|
||||||
/* Set the style classes for the slider, so it could
|
|
||||||
* point to the right direction when marks are present
|
|
||||||
*/
|
|
||||||
context = gtk_widget_get_style_context (GTK_WIDGET (scale));
|
|
||||||
|
|
||||||
if (priv->top_marks_node)
|
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
|
||||||
else
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
|
||||||
if (priv->bottom_marks_node)
|
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
|
||||||
else
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
|
||||||
|
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (scale));
|
gtk_widget_queue_resize (GTK_WIDGET (scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user