cssnode: Add gtk_css_node_invalidate_style_provider()

This function not just invalidates the current node, but also all
children.
This commit is contained in:
Benjamin Otte
2015-02-17 16:11:38 +01:00
parent 16b8972bee
commit cadf6a9d3c
3 changed files with 22 additions and 1 deletions

View File

@ -438,6 +438,9 @@ gtk_css_node_reposition (GtkCssNode *node,
{
gtk_css_node_parent_was_unset (node);
}
if (gtk_css_node_get_style_provider_or_null (node) == NULL)
gtk_css_node_invalidate_style_provider (node);
}
if (parent)
@ -736,6 +739,22 @@ gtk_css_node_get_declaration (GtkCssNode *cssnode)
return cssnode->decl;
}
void
gtk_css_node_invalidate_style_provider (GtkCssNode *cssnode)
{
GtkCssNode *child;
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_SOURCE);
for (child = cssnode->first_child;
child;
child = child->next_sibling)
{
if (gtk_css_node_get_style_provider_or_null (child) == NULL)
gtk_css_node_invalidate_style_provider (child);
}
}
void
gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change)