forked from AuroraMiddleware/gtk
css: Change currentColor handling
We now pass NULL when the current color should be the default value of the "color" property and we haven't looked up any value yet. This way we don't need to look it up all the time and more importantly we can resolve the default color, which is required because it's a GtkCssColorValue and not a GtkCssRgbaValue. Fixes assertions triggering at Polari startup.
This commit is contained in:
parent
04b7c8e24e
commit
e6e99c4f9f
@ -150,7 +150,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
|
||||
g_return_val_if_fail (current != NULL, NULL);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
@ -271,7 +270,12 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return _gtk_css_color_value_resolve (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)),
|
||||
provider,
|
||||
NULL,
|
||||
0,
|
||||
dependencies,
|
||||
cycle_list);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -320,7 +324,7 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
}
|
||||
else
|
||||
{
|
||||
current = _gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR));
|
||||
current = NULL;
|
||||
current_deps = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user