[gtk+/gtk-style-context: 292/347] GtkWidget: Ensure name changes involve a style context update.



commit ed516cc22ed314faef3c484ffea0730728dd0129
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 29 06:01:51 2010 +0200

    GtkWidget: Ensure name changes involve a style context update.

 gtk/gtkwidget.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 453e2e8..64cd7a4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6767,6 +6767,18 @@ gtk_widget_set_name (GtkWidget	 *widget,
   g_free (priv->name);
   priv->name = new_name;
 
+  if (priv->path)
+    {
+      guint pos;
+
+      pos = gtk_widget_path_length (priv->path) - 1;
+      gtk_widget_path_iter_set_name (priv->path, pos,
+                                     priv->name);
+    }
+
+  if (priv->context)
+    gtk_style_context_set_path (priv->context, priv->path);
+
   if (priv->rc_style)
     gtk_widget_reset_rc_style (widget);
 



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