stylecontext: Only create transitions conditionally

While regular animations should always be created, transitions should
not. This patch allows to express this by passing NULL as the values to
transition from.

It also adds a gtk_style_context_should_create_transitions() function
that returns TRUE when transitions should be created.
This commit is contained in:
Benjamin Otte
2012-09-17 11:30:21 +02:00
parent 7712d41b5e
commit 4a281edc87
2 changed files with 24 additions and 2 deletions

View File

@ -492,7 +492,8 @@ _gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
GtkCssComputedValues *source,
GtkStyleContext *context)
{
gtk_css_computed_values_create_css_transitions (values, timestamp, source);
if (source != NULL)
gtk_css_computed_values_create_css_transitions (values, timestamp, source);
gtk_css_computed_values_create_css_animations (values, timestamp, context);
}