[gnome-shell] st/theme-node: Support "auto" in lengths



commit fc36837606bb8b66c6426b686a2d8e151bb36a3c
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jan 31 17:56:40 2020 +0100

    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 bb630d9d3c..31057b0129 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]