From fc36837606bb8b66c6426b686a2d8e151bb36a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 31 Jan 2020 17:56:40 +0100 Subject: [PATCH] st/theme-node: Support "auto" in lengths This allows resetting a fixed size to the default in a more specific selector. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/971 --- src/st/st-theme-node.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index bb630d9d3..31057b012 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -1707,7 +1707,13 @@ do_size_property (StThemeNode *node, CRDeclaration *decl, int *node_value) { - get_length_from_term_int (node, decl->value, FALSE, node_value); + CRTerm *term = decl->value; + + if (term->type == TERM_IDENT && + strcmp (term->content.str->stryng->str, "auto") == 0) + *node_value = -1; + else + get_length_from_term_int (node, term, FALSE, node_value); } void