cssnode: Move style context function to only user
This commit is contained in:
@ -84,6 +84,30 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node)
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_widget_node_should_create_transitions (GtkCssWidgetNode *widget_node,
|
||||
GtkCssStyle *previous_style)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
gboolean animate;
|
||||
|
||||
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;
|
||||
|
||||
g_object_get (gtk_widget_get_settings (widget),
|
||||
"gtk-enable-animations", &animate,
|
||||
NULL);
|
||||
|
||||
return animate;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_static_style_needs_revalidate (GtkCssStaticStyle *style,
|
||||
GtkCssChange change)
|
||||
@ -149,7 +173,7 @@ gtk_css_widget_node_validate (GtkCssNode *node,
|
||||
parent ? gtk_css_node_get_style (parent) : NULL,
|
||||
timestamp,
|
||||
gtk_css_node_get_style_provider (node),
|
||||
gtk_style_context_should_create_transitions (context, style) ? style : NULL);
|
||||
gtk_css_widget_node_should_create_transitions (widget_node, style) ? style : NULL);
|
||||
|
||||
g_object_unref (new_static_style);
|
||||
}
|
||||
|
@ -2424,36 +2424,6 @@ gtk_style_context_do_invalidate (GtkStyleContext *context,
|
||||
priv->invalidating_context = NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_style_context_should_create_transitions (GtkStyleContext *context,
|
||||
GtkCssStyle *previous_style)
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
GtkWidget *widget;
|
||||
gboolean animate;
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
if (GTK_IS_CSS_WIDGET_NODE (priv->cssnode))
|
||||
return FALSE;
|
||||
|
||||
widget = gtk_css_widget_node_get_widget (GTK_CSS_WIDGET_NODE (priv->cssnode));
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_widget_get_mapped (widget))
|
||||
return FALSE;
|
||||
|
||||
if (previous_style == gtk_css_static_style_get_default ())
|
||||
return FALSE;
|
||||
|
||||
g_object_get (gtk_widget_get_settings (widget),
|
||||
"gtk-enable-animations", &animate,
|
||||
NULL);
|
||||
|
||||
return animate;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_style_context_validate (GtkStyleContext *context,
|
||||
const GtkBitmask *changes)
|
||||
|
@ -45,8 +45,6 @@ GtkCssValue * _gtk_style_context_peek_property (GtkStyleContext *c
|
||||
const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
GType widget_type,
|
||||
GParamSpec *pspec);
|
||||
gboolean gtk_style_context_should_create_transitions (GtkStyleContext *context,
|
||||
GtkCssStyle *previous_style);
|
||||
void gtk_style_context_validate (GtkStyleContext *context,
|
||||
const GtkBitmask*changes);
|
||||
gboolean _gtk_style_context_check_region_name (const gchar *str);
|
||||
|
Reference in New Issue
Block a user