[gtk+] Make gtk_widget_get_path() also add all persistent style classes the widget has.



commit 5f43a51a83c7ff7aea1114fb4dda96800cda83d5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 17 04:05:44 2011 +0100

    Make gtk_widget_get_path() also add all persistent style classes the widget has.

 gtk/gtkwidget.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 325788b..40ec604 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -14122,8 +14122,22 @@ gtk_widget_get_path (GtkWidget *widget)
         gtk_widget_path_iter_set_name (widget->priv->path, pos, widget->priv->name);
 
       if (widget->priv->context)
-        gtk_style_context_set_path (widget->priv->context,
-                                    widget->priv->path);
+        {
+          GList *classes, *l;
+
+          /* Also add any persistent classes in
+           * the style context the widget path
+           */
+          classes = gtk_style_context_list_classes (widget->priv->context);
+
+          for (l = classes; l; l = l->next)
+            gtk_widget_path_iter_add_class (widget->priv->path, pos, l->data);
+
+          gtk_style_context_set_path (widget->priv->context,
+                                      widget->priv->path);
+
+          g_list_free (classes);
+        }
     }
 
   return widget->priv->path;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]