diff options
author | Benjamin Otte <otte@redhat.com> | 2014-10-23 04:10:03 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-01-07 14:26:46 +0100 |
commit | 4168e0385efd9231731ed35b96ce58bafc3eb03f (patch) | |
tree | 1b43a6658abd650fce4f1eb1a4a17dd16d0098d6 /gtk/gtkstylecontext.c | |
parent | 572f46067f44da99e9ee0ea3210e1c0fac148928 (diff) | |
download | gtk+-4168e0385efd9231731ed35b96ce58bafc3eb03f.tar.gz |
cssstyle: Split into GtkCssStyle and GtkCssAnimatedStyle
GtkCssStyle is the base class to be used for all types of styles that do
exist.
GtkCssAnimatedStyle is the only implementation so far, that is exactly a
copy/paste of the old GtkCssStyle code.
Diffstat (limited to 'gtk/gtkstylecontext.c')
-rw-r--r-- | gtk/gtkstylecontext.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index cdd66f0cbe..479bf14a3a 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -503,7 +503,7 @@ gtk_style_context_should_animate (GtkStyleContext *context) return FALSE; values = style_values_lookup (context); - if (gtk_css_style_is_static (values)) + if (gtk_css_animated_style_is_static (GTK_CSS_ANIMATED_STYLE (values))) return FALSE; g_object_get (gtk_widget_get_settings (context->priv->widget), @@ -704,7 +704,7 @@ build_properties (GtkStyleContext *context, _gtk_css_lookup_resolve (lookup, GTK_STYLE_PROVIDER_PRIVATE (priv->cascade), priv->scale, - values, + GTK_CSS_ANIMATED_STYLE (values), priv->parent ? style_values_lookup (priv->parent) : NULL); _gtk_css_lookup_free (lookup); @@ -734,7 +734,7 @@ style_values_lookup (GtkStyleContext *context) return values; } - values = gtk_css_style_new (); + values = gtk_css_animated_style_new (); style_info_set_values (info, values); if (gtk_style_context_is_saved (context)) @@ -772,7 +772,7 @@ style_values_lookup_for_state (GtkStyleContext *context, decl = gtk_css_node_declaration_ref (context->priv->info->decl); gtk_css_node_declaration_set_state (&decl, state); - values = gtk_css_style_new (); + values = gtk_css_animated_style_new (); build_properties (context, values, decl, NULL, NULL); gtk_css_node_declaration_unref (decl); @@ -2696,9 +2696,9 @@ gtk_style_context_update_animations (GtkStyleContext *context, values = style_values_lookup (context); - differences = gtk_css_style_advance (values, timestamp); + differences = gtk_css_animated_style_advance (GTK_CSS_ANIMATED_STYLE (values), timestamp); - if (gtk_css_style_is_static (values)) + if (gtk_css_animated_style_is_static (GTK_CSS_ANIMATED_STYLE (values))) _gtk_style_context_update_animating (context); return differences; @@ -2805,13 +2805,15 @@ _gtk_style_context_validate (GtkStyleContext *context, values = style_values_lookup (context); if (values != current) - gtk_css_style_create_animations (values, - priv->parent ? style_values_lookup (priv->parent) : NULL, - timestamp, - GTK_STYLE_PROVIDER_PRIVATE (priv->cascade), - priv->scale, - gtk_style_context_should_create_transitions (context) ? current : NULL); - if (gtk_css_style_is_static (values)) + gtk_css_animated_style_create_animations (GTK_CSS_ANIMATED_STYLE (values), + priv->parent ? GTK_CSS_ANIMATED_STYLE (style_values_lookup (priv->parent)) : NULL, + timestamp, + GTK_STYLE_PROVIDER_PRIVATE (priv->cascade), + priv->scale, + gtk_style_context_should_create_transitions (context) + ? GTK_CSS_ANIMATED_STYLE (current) + : NULL); + if (gtk_css_animated_style_is_static (GTK_CSS_ANIMATED_STYLE (values))) change &= ~GTK_CSS_CHANGE_ANIMATE; else change |= GTK_CSS_CHANGE_ANIMATE; |