Commit 29544173 authored by Benjamin Otte's avatar Benjamin Otte

cssnode: Change the way we start animations

We now have a flag for "invalidate animations", use that to restart
animations and decide if we want to start transitions.
parent 172f345d
...@@ -85,22 +85,9 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node) ...@@ -85,22 +85,9 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node)
} }
static gboolean static gboolean
gtk_css_widget_node_should_create_transitions (GtkCssWidgetNode *widget_node, should_create_transitions (GtkCssChange change)
GtkCssStyle *previous_style)
{ {
GtkWidget *widget; return (change & GTK_CSS_CHANGE_ANIMATIONS) == 0;
widget = widget_node->widget;
if (widget == NULL)
return FALSE;
if (!gtk_widget_get_mapped (widget))
return FALSE;
if (previous_style == gtk_css_static_style_get_default ())
return FALSE;
return TRUE;
} }
static gboolean static gboolean
...@@ -168,7 +155,7 @@ gtk_css_widget_node_validate (GtkCssNode *node, ...@@ -168,7 +155,7 @@ gtk_css_widget_node_validate (GtkCssNode *node,
parent ? gtk_css_node_get_style (parent) : NULL, parent ? gtk_css_node_get_style (parent) : NULL,
timestamp, timestamp,
gtk_css_node_get_style_provider (node), gtk_css_node_get_style_provider (node),
gtk_css_widget_node_should_create_transitions (widget_node, style) ? style : NULL); should_create_transitions (change) ? style : NULL);
g_object_unref (new_static_style); g_object_unref (new_static_style);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment