cssnode: Add gtk_style_context_get_style_provider()

... and use it when looking up properties.
This commit is contained in:
Benjamin Otte
2015-01-31 16:30:05 +01:00
parent 6dc6af674c
commit 03ac5f310b
6 changed files with 54 additions and 8 deletions

View File

@ -108,6 +108,17 @@ gtk_css_widget_node_get_widget_path (GtkCssNode *node)
return gtk_widget_get_path (widget_node->widget);
}
static GtkStyleProviderPrivate *
gtk_css_widget_node_get_style_provider (GtkCssNode *node)
{
GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
if (widget_node->widget == NULL)
return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->get_style_provider (node);
return gtk_style_context_get_style_provider (gtk_widget_get_style_context (widget_node->widget));
}
static void
gtk_css_widget_node_class_init (GtkCssWidgetNodeClass *klass)
{
@ -118,6 +129,7 @@ gtk_css_widget_node_class_init (GtkCssWidgetNodeClass *klass)
node_class->set_invalid = gtk_css_widget_node_set_invalid;
node_class->create_widget_path = gtk_css_widget_node_create_widget_path;
node_class->get_widget_path = gtk_css_widget_node_get_widget_path;
node_class->get_style_provider = gtk_css_widget_node_get_style_provider;
}
static void