diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c index 40d29721e0..ba94a7fb2e 100644 --- a/gtk/gtkwidgetpath.c +++ b/gtk/gtkwidgetpath.c @@ -22,6 +22,7 @@ #include "gtkwidget.h" #include "gtkwidgetpath.h" #include "gtkstylecontextprivate.h" +#include "gtktypebuiltins.h" /** * SECTION:gtkwidgetpath @@ -327,6 +328,28 @@ gtk_widget_path_to_string (const GtkWidgetPath *path) g_string_append_c (string, ')'); } + if (elem->state) + { + GFlagsClass *fclass; + gint i; + gboolean appended; + + appended = FALSE; + fclass = g_type_class_ref (GTK_TYPE_STATE_FLAGS); + g_string_append_c (string, '['); + for (i = 0; i < fclass->n_values; i++) + { + if (elem->state & fclass->values[i].value) + { + if (appended) + g_string_append_c (string, '|'); + g_string_append (string, fclass->values[i].value_nick); + appended = TRUE; + } + } + g_string_append_c (string, ']'); + g_type_class_unref (fclass); + } if (elem->siblings) g_string_append_printf (string, "[%d/%d]",