Commit 51da8cb2 authored by Benjamin Otte's avatar Benjamin Otte

symboliccolor: Parse 'currentColor' everywhere

parent 83be7e5d
......@@ -236,10 +236,7 @@ _gtk_css_shadow_value_parse (GtkCssParser *parser)
{
GtkSymbolicColor *symbolic;
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
else
symbolic = _gtk_css_parser_read_symbolic_color (parser);
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
goto fail;
......
......@@ -221,16 +221,9 @@ parse_border_color (GtkCssShorthandProperty *shorthand,
for (i = 0; i < 4; i++)
{
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
{
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
}
else
{
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
}
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
values[i] = _gtk_css_value_new_take_symbolic_color (symbolic);
......
......@@ -169,16 +169,9 @@ rgba_value_parse (GtkCssParser *parser,
GtkSymbolicColor *symbolic;
GdkRGBA rgba;
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
{
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
}
else
{
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
}
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
if (gtk_symbolic_color_resolve (symbolic, NULL, &rgba))
{
......@@ -312,16 +305,9 @@ symbolic_color_value_parse (GtkCssParser *parser,
{
GtkSymbolicColor *symbolic;
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
{
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
}
else
{
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
}
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return FALSE;
g_value_take_boxed (value, symbolic);
return TRUE;
......
......@@ -183,16 +183,9 @@ color_parse (GtkCssStyleProperty *property,
{
GtkSymbolicColor *symbolic;
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
{
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
}
else
{
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return NULL;
}
symbolic = _gtk_css_parser_read_symbolic_color (parser);
if (symbolic == NULL)
return NULL;
return _gtk_css_value_new_take_symbolic_color (symbolic);
}
......
......@@ -1039,6 +1039,9 @@ _gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
g_return_val_if_fail (parser != NULL, NULL);
if (_gtk_css_parser_try (parser, "currentColor", TRUE))
return gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
if (_gtk_css_parser_try (parser, "transparent", TRUE))
{
GdkRGBA transparent = { 0, 0, 0, 0 };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment