]> Pileus Git - ~andy/gtk/commitdiff
styleproperty: make background-position an array property
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 10 May 2012 14:39:25 +0000 (10:39 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 15 May 2012 17:24:40 +0000 (13:24 -0400)
gtk/gtkcssstylepropertyimpl.c
gtk/gtkthemingbackground.c

index 5fbc5930e61dff90a41ec8c587dd1527b1d3e897..4c194e41cbaf1c9af3a577bfd9059a9c37aff5a6 100644 (file)
@@ -874,7 +874,7 @@ static GtkCssValue *
 background_position_parse (GtkCssStyleProperty *property,
                           GtkCssParser        *parser)
 {
-  return _gtk_css_position_value_parse (parser);
+  return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse, FALSE);
 }
 
 static GtkCssValue *
@@ -882,7 +882,7 @@ background_position_compute (GtkCssStyleProperty    *property,
                             GtkStyleContext        *context,
                             GtkCssValue            *specified)
 {
-  return _gtk_css_position_value_compute (specified, context);
+  return _gtk_css_array_value_compute (specified, _gtk_css_position_value_compute, context);
 }
 
 /*** REGISTRATION ***/
@@ -1295,8 +1295,8 @@ _gtk_css_style_property_init_properties (void)
                                           background_position_compute,
                                           NULL,
                                           NULL,
-                                          _gtk_css_position_value_new (_gtk_css_number_value_new (0, GTK_CSS_PERCENT),
-                                                                       _gtk_css_number_value_new (0, GTK_CSS_PERCENT)));
+                                          _gtk_css_array_value_new (_gtk_css_position_value_new (_gtk_css_number_value_new (0, GTK_CSS_PERCENT),
+                                                                                                 _gtk_css_number_value_new (0, GTK_CSS_PERCENT))));
 
   gtk_css_style_property_register        ("border-top-color",
                                           GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
index 1bedb784d66e4b489abc727a425225f5b64a9a53..6d006772f8eb88d9c7dc3bfd8909e4595af5a4d5 100644 (file)
@@ -134,7 +134,7 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
       double width, height;
       GtkCssRepeatStyle hrepeat, vrepeat;
 
-      pos = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_POSITION);
+      pos = _gtk_css_array_value_get_nth (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_POSITION), 0);
       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);