[gtk+] gtk: Reset children styles when changing name



commit 8ce533265ed7acbf9031c7ba4120a2932444a802
Author: Benjamin Otte <otte redhat com>
Date:   Sat Mar 26 14:49:24 2011 +0100

    gtk: Reset children styles when changing name
    
    Changing the name of a widget does not just change the current widget's
    path, but also the path of all its children.

 gtk/gtkwidget.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 714f850..ab66dd5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6920,17 +6920,7 @@ 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);
+  gtk_widget_reset_style (widget);
 
   g_object_notify (G_OBJECT (widget), "name");
 }



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