Use get_color_from_term() instead of get_background_color_from_term()

The former already checks for term_is_transparent() as its first
thing.

Part of https://gitlab.gnome.org/GNOME/gnome-shell/issues/1934
This commit is contained in:
Federico Mena Quintero 2019-11-21 18:24:32 -06:00 committed by Florian Müllner
parent 1e8e08ce61
commit 52f5793c9b

View File

@ -1916,24 +1916,6 @@ st_theme_node_get_max_height (StThemeNode *node)
return node->max_height; return node->max_height;
} }
static GetFromTermResult
get_background_color_from_term (StThemeNode *node,
CRTerm *term,
ClutterColor *color)
{
GetFromTermResult result = get_color_from_term (node, term, color);
if (result == VALUE_NOT_FOUND)
{
if (term_is_transparent (term))
{
*color = TRANSPARENT_COLOR;
return VALUE_FOUND;
}
}
return result;
}
void void
_st_theme_node_ensure_background (StThemeNode *node) _st_theme_node_ensure_background (StThemeNode *node)
{ {
@ -1978,7 +1960,7 @@ _st_theme_node_ensure_background (StThemeNode *node)
for (term = decl->value; term; term = term->next) for (term = decl->value; term; term = term->next)
{ {
GetFromTermResult result = get_background_color_from_term (node, term, &node->background_color); GetFromTermResult result = get_color_from_term (node, term, &node->background_color);
if (result == VALUE_FOUND) if (result == VALUE_FOUND)
{ {
/* color stored in node->background_color */ /* color stored in node->background_color */
@ -2087,7 +2069,7 @@ _st_theme_node_ensure_background (StThemeNode *node)
if (decl->value == NULL || decl->value->next != NULL) if (decl->value == NULL || decl->value->next != NULL)
continue; continue;
result = get_background_color_from_term (node, decl->value, &node->background_color); result = get_color_from_term (node, decl->value, &node->background_color);
if (result == VALUE_FOUND) if (result == VALUE_FOUND)
{ {
/* color stored in node->background_color */ /* color stored in node->background_color */