diff --git a/gtk/gtkcsspositionvalue.c b/gtk/gtkcsspositionvalue.c index 9102b16bb0..62ecc68b57 100644 --- a/gtk/gtkcsspositionvalue.c +++ b/gtk/gtkcsspositionvalue.c @@ -291,6 +291,32 @@ _gtk_css_position_value_try_parse (GtkCssParser *parser) return position_value_parse (parser, TRUE); } +GtkCssValue * +gtk_css_position_value_parse_spacing (GtkCssParser *parser) +{ + GtkCssValue *x, *y; + + x = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_LENGTH | GTK_CSS_POSITIVE_ONLY); + if (x == NULL) + return NULL; + + if (gtk_css_number_value_can_parse (parser)) + { + y = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_LENGTH | GTK_CSS_POSITIVE_ONLY); + if (y == NULL) + { + _gtk_css_value_unref (x); + return NULL; + } + } + else + { + y = _gtk_css_value_ref (x); + } + + return _gtk_css_position_value_new (x, y); +} + double _gtk_css_position_value_get_x (const GtkCssValue *position, double one_hundred_percent) diff --git a/gtk/gtkcsspositionvalueprivate.h b/gtk/gtkcsspositionvalueprivate.h index d1d113bb13..fc87fbcbce 100644 --- a/gtk/gtkcsspositionvalueprivate.h +++ b/gtk/gtkcsspositionvalueprivate.h @@ -29,11 +29,12 @@ GtkCssValue * _gtk_css_position_value_new (GtkCssValue *x GtkCssValue *y); GtkCssValue * _gtk_css_position_value_parse (GtkCssParser *parser); GtkCssValue * _gtk_css_position_value_try_parse (GtkCssParser *parser); +GtkCssValue * gtk_css_position_value_parse_spacing (GtkCssParser *parser); double _gtk_css_position_value_get_x (const GtkCssValue *position, - double one_hundred_percent); + double one_hundred_percent); double _gtk_css_position_value_get_y (const GtkCssValue *position, - double one_hundred_percent); + double one_hundred_percent); G_END_DECLS diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index 3571d68dfd..d781d51251 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -562,6 +562,13 @@ transform_value_parse (GtkCssStyleProperty *property, return _gtk_css_transform_value_parse (parser); } +static GtkCssValue * +border_spacing_value_parse (GtkCssStyleProperty *property, + GtkCssParser *parser) +{ + return gtk_css_position_value_parse_spacing (parser); +} + static GtkCssValue * border_corner_radius_value_parse (GtkCssStyleProperty *property, GtkCssParser *parser) @@ -1448,6 +1455,16 @@ _gtk_css_style_property_init_properties (void) NULL, _gtk_css_transform_value_new_none ()); + gtk_css_style_property_register ("border-spacing", + GTK_CSS_PROPERTY_BORDER_SPACING, + G_TYPE_NONE, + GTK_STYLE_PROPERTY_ANIMATED, + GTK_CSS_AFFECTS_SIZE, + border_spacing_value_parse, + NULL, + _gtk_css_position_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX), + _gtk_css_number_value_new (0, GTK_CSS_PX))); + gtk_css_style_property_register ("min-width", GTK_CSS_PROPERTY_MIN_WIDTH, G_TYPE_INT, diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h index bcc1dc04ff..644f0079b7 100644 --- a/gtk/gtkcsstypesprivate.h +++ b/gtk/gtkcsstypesprivate.h @@ -207,6 +207,7 @@ enum { /*< skip >*/ GTK_CSS_PROPERTY_ICON_SHADOW, GTK_CSS_PROPERTY_ICON_STYLE, GTK_CSS_PROPERTY_ICON_TRANSFORM, + GTK_CSS_PROPERTY_BORDER_SPACING, GTK_CSS_PROPERTY_MIN_WIDTH, GTK_CSS_PROPERTY_MIN_HEIGHT, GTK_CSS_PROPERTY_TRANSITION_PROPERTY,