Commit 0bab285f authored by Benjamin Otte's avatar Benjamin Otte

stylecontext: Make build_properties create the style

parent 79f73921
......@@ -713,9 +713,8 @@ update_properties (GtkStyleContext *context,
gtk_widget_path_free (path);
}
static void
static GtkCssStyle *
build_properties (GtkStyleContext *context,
GtkCssStyle *style,
const GtkCssNodeDeclaration *decl,
GtkCssChange *out_change)
{
......@@ -723,9 +722,12 @@ build_properties (GtkStyleContext *context,
GtkCssMatcher matcher;
GtkWidgetPath *path;
GtkCssLookup *lookup;
GtkCssStyle *style;
priv = context->priv;
style = gtk_css_static_style_new ();
path = create_query_path (context, decl);
lookup = _gtk_css_lookup_new (NULL);
......@@ -743,6 +745,8 @@ build_properties (GtkStyleContext *context,
_gtk_css_lookup_free (lookup);
gtk_widget_path_free (path);
return style;
}
static GtkCssStyle *
......@@ -770,18 +774,15 @@ style_values_lookup (GtkStyleContext *context)
return values;
}
values = gtk_css_static_style_new ();
values = build_properties (context, info->decl, NULL);
g_hash_table_insert (priv->style_values,
gtk_css_node_declaration_ref (info->decl),
g_object_ref (values));
build_properties (context, values, info->decl, NULL);
}
else
{
values = gtk_css_static_style_new ();
build_properties (context, values, info->decl, &priv->relevant_changes);
values = build_properties (context, info->decl, &priv->relevant_changes);
/* These flags are always relevant */
priv->relevant_changes |= GTK_CSS_CHANGE_SOURCE;
}
......@@ -807,8 +808,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_static_style_new ();
build_properties (context, values, decl, NULL);
values = build_properties (context, decl, NULL);
gtk_css_node_declaration_unref (decl);
return values;
......
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