Fixed _get_separator_length()
* Use title line(s) and 'Display Name' instead of name * Menu()._update() is required to be run previously
This commit is contained in:
parent
1542ba39cd
commit
2b08654d7c
1 changed files with 6 additions and 2 deletions
|
|
@ -128,10 +128,14 @@ class Menu():
|
|||
"""Format separator length based on name lengths, returns str."""
|
||||
separator_length = 0
|
||||
|
||||
# Check title line(s)
|
||||
for line in self.title.split('\n'):
|
||||
separator_length = max(separator_length, len(line))
|
||||
|
||||
# Loop over all item names
|
||||
for section in (self.actions, self.options, self.sets, self.toggles):
|
||||
for name in section.keys():
|
||||
separator_length = max(separator_length, len(name))
|
||||
for details in section.values():
|
||||
separator_length = max(separator_length, len(details['Display Name']))
|
||||
separator_length += 1
|
||||
|
||||
# Done
|
||||
|
|
|
|||
Loading…
Reference in a new issue