[gtk+/wip/css: 35/36] stylecontext: Always create animations



commit d790fb9d83b7f55d8af2a8414a12f0e441db0fc5
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 17 11:34:54 2012 +0200

    stylecontext: Always create animations
    
    Even when there is no current values, do create animations. This ensures
    that animations do exist for unmapped widgets when they get mapped
    later.

 gtk/gtkstylecontext.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 65c9737..aedd01b 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3147,6 +3147,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
   if (current == NULL ||
       gtk_style_context_needs_full_revalidate (context, change))
     {
+      StyleData *data;
+
       if ((priv->relevant_changes & change) & ~GTK_STYLE_CONTEXT_CACHED_CHANGE)
         {
           gtk_style_context_clear_cache (context);
@@ -3157,22 +3159,20 @@ _gtk_style_context_validate (GtkStyleContext  *context,
           style_info_set_data (info, NULL);
         }
 
-      if (current)
-        {
-          StyleData *data;
-
-          data = style_data_lookup (context);
+      data = style_data_lookup (context);
 
-          _gtk_css_computed_values_create_animations (data->store,
-                                                      timestamp,
-                                                      gtk_style_context_should_create_transitions (context) ? current->store : NULL,
-                                                      context);
-          if (_gtk_css_computed_values_is_static (data->store))
-            change &= ~GTK_CSS_CHANGE_ANIMATE;
-          else
-            change |= GTK_CSS_CHANGE_ANIMATE;
-          _gtk_style_context_update_animating (context);
+      _gtk_css_computed_values_create_animations (data->store,
+                                                  timestamp,
+                                                  current && gtk_style_context_should_create_transitions (context) ? current->store : NULL,
+                                                  context);
+      if (_gtk_css_computed_values_is_static (data->store))
+        change &= ~GTK_CSS_CHANGE_ANIMATE;
+      else
+        change |= GTK_CSS_CHANGE_ANIMATE;
+      _gtk_style_context_update_animating (context);
 
+      if (current)
+        {
           changes = _gtk_css_computed_values_get_difference (data->store, current->store);
 
           /* In the case where we keep the cache, we want unanimated values */



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