[engine/output] Use (experimental) custom widget padding

When padding a widget, instead of using the "min_width" field of the
i3bar protocol, which seems to "swallow" click events, perform a custom
padding by simply extending the right-hand side with spaces.

fixes #334
This commit is contained in:
Tobias Witek 2018-11-25 17:50:05 +01:00
parent 22419b813f
commit 7d55bdce6c

View file

@ -125,13 +125,18 @@ class I3BarOutput(object):
"separator_block_width": self._theme.separator_block_width(widget),
})
width = self._theme.minwidth(widget)
if width:
full_text = full_text.ljust(len(width) + len(prefix) + len(suffix))
self._widgets.append({
u"full_text": full_text,
"color": self._theme.fg(widget),
"background": self._theme.bg(widget),
"separator_block_width": self._theme.separator_block_width(widget),
"separator": True if separator is None else False,
"min_width": width + "A"*(len(prefix) + len(suffix)) if width else None,
"min_width": None,
# "min_width": width + "A"*(len(prefix) + len(suffix)) if width else None,
"align": self._theme.align(widget),
"instance": widget.id,
"name": module.id,