Update evmenu.py
This commit is contained in:
parent
7a7416b084
commit
0afe81873c
1 changed files with 10 additions and 1 deletions
|
|
@ -1206,7 +1206,16 @@ class EvMenu:
|
||||||
else:
|
else:
|
||||||
# add a default white color to key
|
# add a default white color to key
|
||||||
table.append(f" |lc{raw_key}|lt|w{key}|n|le{desc_string}")
|
table.append(f" |lc{raw_key}|lt|w{key}|n|le{desc_string}")
|
||||||
ncols = _MAX_TEXT_WIDTH // table_width_max # number of columns
|
|
||||||
|
# check if the caller is using a screenreader
|
||||||
|
screenreader_mode = False
|
||||||
|
if session := getattr(self.caller, 'session', None):
|
||||||
|
screenreader_mode = session.protocol_flags.get("SCREENREADER")
|
||||||
|
# the caller doesn't have a session; check it directly
|
||||||
|
elif hasattr(self.caller, 'protocol_flags'):
|
||||||
|
screenreader_mode = self.caller.protocol_flags.get("SCREENREADER")
|
||||||
|
|
||||||
|
ncols = 1 if screenreader_mode else _MAX_TEXT_WIDTH // table_width_max
|
||||||
|
|
||||||
if ncols < 0:
|
if ncols < 0:
|
||||||
# no visible options at all
|
# no visible options at all
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue