[gtk+] styleproperty: make background-position an array property



commit 9b0467339207e9b87f86796c8c9802ea6126c7af
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu May 10 10:39:25 2012 -0400

    styleproperty: make background-position an array property

 gtk/gtkcssstylepropertyimpl.c |    8 ++++----
 gtk/gtkthemingbackground.c    |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 5fbc593..4c194e4 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -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,
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index 1bedb78..6d00677 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]