diff options
author | Benjamin Otte <otte@redhat.com> | 2014-12-21 20:26:26 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-01-07 14:26:48 +0100 |
commit | 26f36ef8aefb81c3d87f4c577a248efd77733e2d (patch) | |
tree | 7c75709512a7cad4ba14e6a492ee5a70ebeff459 /gtk/gtkstylecontext.c | |
parent | 9645daf48fa28c26ff623fc9541a860217426e60 (diff) | |
download | gtk+-26f36ef8aefb81c3d87f4c577a248efd77733e2d.tar.gz |
cssnodedeclaration: Store the GType of the node
Diffstat (limited to 'gtk/gtkstylecontext.c')
-rw-r--r-- | gtk/gtkstylecontext.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 747ad745c6..2b34d0d2e7 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -881,6 +881,11 @@ _gtk_style_context_set_widget (GtkStyleContext *context, context->priv->widget = widget; + if (widget) + gtk_css_node_declaration_set_type (&context->priv->info->decl, G_OBJECT_TYPE (widget)); + else + gtk_css_node_declaration_set_type (&context->priv->info->decl, G_TYPE_NONE); + _gtk_style_context_update_animating (context); _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY_SELF); @@ -1373,10 +1378,17 @@ gtk_style_context_set_path (GtkStyleContext *context, { gtk_widget_path_free (priv->widget_path); priv->widget_path = NULL; + gtk_css_node_declaration_set_type (&context->priv->info->decl, G_TYPE_NONE); } if (path) - priv->widget_path = gtk_widget_path_copy (path); + { + priv->widget_path = gtk_widget_path_copy (path); + if (gtk_widget_path_length (path)) + gtk_css_node_declaration_set_type (&context->priv->info->decl, + gtk_widget_path_iter_get_object_type (path, -1)); + } + _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY); } |