css: add properties for outline-radius

Both a shorthand and individual properties. This is not officially part
of the CSS standard, but there's precedence for it at least in Mozilla:
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius
This commit is contained in:
Cosimo Cecchi 2014-05-01 18:11:23 +02:00
parent a60ba815d9
commit e8cbbedbb2
4 changed files with 53 additions and 0 deletions

View File

@ -277,6 +277,10 @@ gtk_css_value_array_transition (GtkCssValue *start,
case GTK_CSS_PROPERTY_OUTLINE_STYLE:
case GTK_CSS_PROPERTY_OUTLINE_WIDTH:
case GTK_CSS_PROPERTY_OUTLINE_OFFSET:
case GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS:
case GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS:
case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS:
case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS:
case GTK_CSS_PROPERTY_BORDER_TOP_COLOR:
case GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR:
case GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR:

View File

@ -1111,6 +1111,8 @@ _gtk_css_shorthand_property_init_properties (void)
"border-top-color", "border-right-color", "border-bottom-color", "border-left-color",
"border-image-source", "border-image-slice", "border-image-width", "border-image-repeat", NULL };
const char *outline_subproperties[] = { "outline-width", "outline-style", "outline-color", NULL };
const char *outline_radius_subproperties[] = { "outline-top-left-radius", "outline-top-right-radius",
"outline-bottom-right-radius", "outline-bottom-left-radius", NULL };
const char *background_subproperties[] = { "background-image", "background-position", "background-size", "background-repeat", "background-clip", "background-origin",
"background-color", NULL };
const char *transition_subproperties[] = { "transition-property", "transition-duration", "transition-delay", "transition-timing-function", NULL };
@ -1195,6 +1197,12 @@ _gtk_css_shorthand_property_init_properties (void)
parse_border,
NULL,
NULL);
_gtk_css_shorthand_property_register ("outline-radius",
G_TYPE_INT,
outline_radius_subproperties,
parse_border_radius,
unpack_border_radius,
pack_border_radius);
_gtk_css_shorthand_property_register ("outline",
G_TYPE_NONE,
outline_subproperties,

View File

@ -1169,6 +1169,43 @@ _gtk_css_style_property_init_properties (void)
assign_length_from_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("outline-top-left-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
_gtk_css_corner_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 ("outline-top-right-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
_gtk_css_corner_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 ("outline-bottom-right-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
_gtk_css_corner_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 ("outline-bottom-left-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
border_corner_radius_value_parse,
NULL,
NULL,
_gtk_css_corner_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 ("background-clip",
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
G_TYPE_NONE,

View File

@ -105,6 +105,10 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_OUTLINE_STYLE,
GTK_CSS_PROPERTY_OUTLINE_WIDTH,
GTK_CSS_PROPERTY_OUTLINE_OFFSET,
GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
GTK_CSS_PROPERTY_BACKGROUND_SIZE,