[gtk+/gtk-style-context: 100/490] GtkWidget: Do not reset GtkStyleContext per get_style_context().



commit bb76d24b413f0aa8f07d58d7f1876fc0f9141df2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 18 17:25:53 2010 +0200

    GtkWidget: Do not reset GtkStyleContext per get_style_context().

 gtk/gtkwidget.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b7d23c8..549ac83 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13301,18 +13301,19 @@ gtk_widget_get_style_context (GtkWidget *widget)
           g_object_unref (css_file);
         }
 
-      gtk_style_context_add_provider (context, css_provider,
+      gtk_style_context_add_provider (context,
+                                      GTK_STYLE_PROVIDER (css_provider),
                                       GTK_STYLE_PROVIDER_PRIORITY_USER);
-    }
 
-  if (widget->parent ||
-      gtk_widget_is_toplevel (widget))
-    {
-      GtkWidgetPath *path;
+      if (widget->parent ||
+          gtk_widget_is_toplevel (widget))
+        {
+          GtkWidgetPath *path;
 
-      path = gtk_widget_get_path (widget);
-      gtk_style_context_set_path (context, path);
-      gtk_widget_path_free (path);
+          path = gtk_widget_get_path (widget);
+          gtk_style_context_set_path (context, path);
+          gtk_widget_path_free (path);
+        }
     }
 
   return context;



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