styleproperty: make background-repeat an array property

This commit is contained in:
Cosimo Cecchi 2012-05-10 10:31:06 -04:00
parent f8e6e272a7
commit ed12be7e81
2 changed files with 11 additions and 5 deletions

View File

@ -835,8 +835,7 @@ compute_border_width (GtkCssStyleProperty *property,
}
static GtkCssValue *
background_repeat_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
background_repeat_value_parse_one (GtkCssParser *parser)
{
GtkCssValue *value = _gtk_css_background_repeat_value_try_parse (parser);
@ -849,6 +848,13 @@ background_repeat_value_parse (GtkCssStyleProperty *property,
return value;
}
static GtkCssValue *
background_repeat_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one, FALSE);
}
static GtkCssValue *
background_size_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
@ -1362,8 +1368,8 @@ _gtk_css_style_property_init_properties (void)
NULL,
NULL,
NULL,
_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_REPEAT));
_gtk_css_array_value_new (_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_REPEAT)));
gtk_css_style_property_register ("background-image",
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
CAIRO_GOBJECT_TYPE_PATTERN,

View File

@ -135,7 +135,7 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
GtkCssRepeatStyle hrepeat, vrepeat;
pos = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_POSITION);
repeat = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_REPEAT);
repeat = _gtk_css_array_value_get_nth (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_REPEAT), 0);
hrepeat = _gtk_css_background_repeat_value_get_x (repeat);
vrepeat = _gtk_css_background_repeat_value_get_y (repeat);
width = bg->image_rect.width;