diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-01-12 21:34:56 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-01-15 00:36:23 +0200 |
commit | c60cea3037719508e42b4ebf91ef076d1c7b74e1 (patch) | |
tree | 788b6971b6b079bc3da917e94cb0c9fabe2e9e1a /gtk/gtkwidgetpath.c | |
parent | 276101a3bc33407fb4efbf4d020fc559f22150da (diff) | |
download | gtk+-c60cea3037719508e42b4ebf91ef076d1c7b74e1.tar.gz |
gtkwidgetpath: update gtk_widget_path_to_string
From gtk_widget_path_iter_set_object_name documentation:
"When set, the object name overrides the object type when matching CSS"
Update gtk_widget_path_to_string to match this behaviour.
Diffstat (limited to 'gtk/gtkwidgetpath.c')
-rw-r--r-- | gtk/gtkwidgetpath.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c index f28ddc990d..f0297dff32 100644 --- a/gtk/gtkwidgetpath.c +++ b/gtk/gtkwidgetpath.c @@ -298,7 +298,10 @@ gtk_widget_path_to_string (const GtkWidgetPath *path) if (i > 0) g_string_append_c (string, ' '); - g_string_append (string, g_type_name (gtk_css_node_declaration_get_type (elem->decl))); + if (gtk_css_node_declaration_get_name (elem->decl)) + g_string_append (string, gtk_css_node_declaration_get_name (elem->decl)); + else + g_string_append (string, g_type_name (gtk_css_node_declaration_get_type (elem->decl))); if (gtk_css_node_declaration_get_id (elem->decl)) { |