[core/output] Add option to align scrolling
Use -p <module>.theme.align=<left|center|right> to align scrolling output. fixes #550
This commit is contained in:
parent
2cc6fcc5dc
commit
5134ce3b5b
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,13 @@ def scrollable(func):
|
|||
if width < 0:
|
||||
return text
|
||||
if len(text) <= width:
|
||||
# do alignment
|
||||
align = module.parameter("theme.align", "left")
|
||||
print("alignment: {}".format(align))
|
||||
if align == "right":
|
||||
text = "{:>{}}".format(text, width)
|
||||
if align == "center":
|
||||
text = "{:^{}}".format(text, width)
|
||||
return text
|
||||
# we need to shorten
|
||||
|
||||
|
|
Loading…
Reference in a new issue