diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-29 09:19:16 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-29 09:42:58 +0200 |
| commit | 66a2bf5136945881af3956a6c50475b7dce5a2f7 (patch) | |
| tree | 007da90ca7df6c101783906dd9e7a9b9c1b761b4 /menuconfig.py | |
| parent | c8bd3838206d6fe22143b055c97d8d94342dc271 (diff) | |
menuconfig: Do not use red for invisible symbols outside of show-all mode
Invisible symbols can show up outside show-all mode if an invisible
symbol has visible symbols in an implicit (indented) submenu. Printing
them in red like in show-all mode is the perfectly consistent thing to
do, but might look confusing/broken.
Only print invisible symbols in red in show-all mode.
Also change the bracket style for all invisible bool/tristate symbols to
- - N_SYM
-M- M_SYM
-*- Y_SYM
That makes it clear that they can't be changed, even when they show up
outside show-all mode, and makes logical sense if that style is taken to
always mean that the symbol value can't be changed.
You lose a quick reference for whether a symbol is a bool or tristate,
but it's not a huge deal.
Diffstat (limited to 'menuconfig.py')
| -rwxr-xr-x | menuconfig.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/menuconfig.py b/menuconfig.py index a8053f1..392bc1b 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -969,7 +969,11 @@ def _draw_main(): node = _shown[i] - if node.prompt and expr_value(node.prompt[1]): + # The 'not _show_all' test avoids showing invisible items in red + # outside show-all mode, which could look confusing/broken. Invisible + # symbols show up outside show-all mode if an invisible symbol has + # visible children in an implicit (indented) menu. + if not _show_all or (node.prompt and expr_value(node.prompt[1])): style = _LIST_SEL_STYLE if i == _sel_node_i else _LIST_STYLE else: style = _LIST_INVISIBLE_SEL_STYLE if i == _sel_node_i else \ @@ -2397,7 +2401,7 @@ def _value_str(node): tri_val_str = (" ", "M", "*")[item.tri_value] - if len(item.assignable) == 1: + if len(item.assignable) <= 1: # Pinned to a single value return "" if isinstance(item, Choice) else "-{}-".format(tri_val_str) |
