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



commit e28e23f1790b843df7920788a473afe61cf7ff3e
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 aba2591..6a8749a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6696,6 +6696,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]