summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-13 13:45:42 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-17 02:25:40 +0100
commit63f7a36ae0ccd3b9d5ed96defce76de75671b6ec (patch)
tree68c4bc92aea142c3d0f0cdd220d35fee560f88ff
parent03d4e270c294c2224cf05048caba99e744289bf1 (diff)
downloadgtk+-63f7a36ae0ccd3b9d5ed96defce76de75671b6ec.tar.gz
stylecontext: Do not transition from the default style
This gets rid of a bunch of awkward transitions. It's not a perfect solution to the problem of "should we transition from this state" but it gets rid of the ugliest offenders.
-rw-r--r--gtk/gtkstylecontext.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 25385f0b23..19c2d0ccb8 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2870,7 +2870,8 @@ gtk_style_context_update_cache (GtkStyleContext *context,
}
static gboolean
-gtk_style_context_should_create_transitions (GtkStyleContext *context)
+gtk_style_context_should_create_transitions (GtkStyleContext *context,
+ GtkCssStyle *previous_style)
{
GtkStyleContextPrivate *priv;
gboolean animate;
@@ -2883,6 +2884,9 @@ gtk_style_context_should_create_transitions (GtkStyleContext *context)
if (!gtk_widget_get_mapped (priv->widget))
return FALSE;
+ if (previous_style == gtk_css_static_style_get_default (priv->screen))
+ return FALSE;
+
g_object_get (gtk_widget_get_settings (context->priv->widget),
"gtk-enable-animations", &animate,
NULL);
@@ -2945,7 +2949,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
timestamp,
GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
priv->scale,
- gtk_style_context_should_create_transitions (context) ? current : NULL);
+ gtk_style_context_should_create_transitions (context, current) ? current : NULL);
gtk_css_node_set_values (cssnode, style);