mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
styleproperty: make background-image an array value
This also requires having the GtkCssArrayValue parse func forward the base GFile from the style property parse implementation.
This commit is contained in:
parent
f65970b521
commit
580b585fc9
@ -616,6 +616,49 @@ css_image_value_assign (GtkCssStyleProperty *property,
|
||||
return _gtk_css_image_value_new (NULL);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
background_image_value_parse_one (GtkCssParser *parser)
|
||||
{
|
||||
return css_image_value_parse (NULL, parser);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
background_image_value_parse (GtkCssStyleProperty *property,
|
||||
GtkCssParser *parser)
|
||||
{
|
||||
return _gtk_css_array_value_parse (parser, background_image_value_parse_one, FALSE);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
background_image_value_compute_one (GtkCssValue *value,
|
||||
GtkStyleContext *context)
|
||||
{
|
||||
return css_image_value_compute (NULL, context, value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
background_image_value_compute (GtkCssStyleProperty *property,
|
||||
GtkStyleContext *context,
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
return _gtk_css_array_value_compute (specified, background_image_value_compute_one, context);
|
||||
}
|
||||
|
||||
static void
|
||||
background_image_value_query (GtkCssStyleProperty *property,
|
||||
const GtkCssValue *css_value,
|
||||
GValue *value)
|
||||
{
|
||||
css_image_value_query (property, _gtk_css_array_value_get_nth (css_value, 0), value);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
background_image_value_assign (GtkCssStyleProperty *property,
|
||||
const GValue *value)
|
||||
{
|
||||
return _gtk_css_array_value_new (css_image_value_assign (property, value));
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
font_size_parse (GtkCssStyleProperty *property,
|
||||
GtkCssParser *parser)
|
||||
@ -1374,12 +1417,12 @@ _gtk_css_style_property_init_properties (void)
|
||||
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
|
||||
CAIRO_GOBJECT_TYPE_PATTERN,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
css_image_value_parse,
|
||||
background_image_value_parse,
|
||||
NULL,
|
||||
css_image_value_compute,
|
||||
css_image_value_query,
|
||||
css_image_value_assign,
|
||||
_gtk_css_image_value_new (NULL));
|
||||
background_image_value_compute,
|
||||
background_image_value_query,
|
||||
background_image_value_assign,
|
||||
_gtk_css_array_value_new (_gtk_css_image_value_new (NULL)));
|
||||
|
||||
gtk_css_style_property_register ("border-image-source",
|
||||
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
|
||||
|
@ -292,7 +292,7 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg)
|
||||
_gtk_theming_background_apply_clip (bg);
|
||||
_gtk_theming_background_apply_origin (bg);
|
||||
|
||||
bg->image = _gtk_css_image_value_get_image (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_IMAGE));
|
||||
bg->image = _gtk_css_image_value_get_image (_gtk_css_array_value_get_nth (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_IMAGE), 0));
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user