[gtk+/gtk-style-context: 333/490] GtkStyleContext: restore widget state too in restore().



commit cba02e19bda63a8118f73accff28313e2db716b5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Nov 8 02:53:12 2010 +0100

    GtkStyleContext: restore widget state too in restore().

 gtk/gtkstylecontext.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index aaaf782..ed2e68d 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -222,6 +222,7 @@ struct GtkStyleInfo
   GArray *style_classes;
   GArray *regions;
   GtkJunctionSides junction_sides;
+  GtkStateFlags state_flags;
 };
 
 struct StyleData
@@ -256,8 +257,6 @@ struct GtkStyleContextPrivate
   GSList *info_stack;
   StyleData *current_data;
 
-  GtkStateFlags state_flags;
-
   GSList *animation_regions;
   GSList *animations;
 
@@ -1275,11 +1274,13 @@ gtk_style_context_set_state (GtkStyleContext *context,
                              GtkStateFlags    flags)
 {
   GtkStyleContextPrivate *priv;
+  GtkStyleInfo *info;
 
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
   priv = context->priv;
-  priv->state_flags = flags;
+  info = priv->info_stack->data;
+  info->state_flags = flags;
 }
 
 /**
@@ -1296,11 +1297,14 @@ GtkStateFlags
 gtk_style_context_get_state (GtkStyleContext *context)
 {
   GtkStyleContextPrivate *priv;
+  GtkStyleInfo *info;
 
   g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
 
   priv = context->priv;
-  return priv->state_flags;
+  info = priv->info_stack->data;
+
+  return info->state_flags;
 }
 
 static gboolean



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