From 1a82a717fa1415998f13990a7baf75eeddc5490f Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sun, 23 Apr 2017 07:15:07 +0200 Subject: [PATCH] [core] Calculate minwidth including pre/suffix Add the length of the prefix and suffix to the minimum width, if applicable. --- bumblebee/output.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index bf6a689..cf1de79 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -70,10 +70,13 @@ class I3BarOutput(object): padding = self._theme.padding(widget) prefix = self._theme.prefix(widget, padding) suffix = self._theme.suffix(widget, padding) + minwidth = self._theme.minwidth(widget) if prefix: full_text = u"{}{}".format(prefix, full_text) + if minwidth: minwidth += "A"*len(prefix) if suffix: full_text = u"{}{}".format(full_text, suffix) + if minwidth: minwidth += "A"*len(suffix) separator = self._theme.separator(widget) if separator: self._widgets.append({ @@ -89,7 +92,7 @@ class I3BarOutput(object): "background": self._theme.bg(widget), "separator_block_width": self._theme.separator_block_width(widget), "separator": True if separator is None else False, - "min_width": self._theme.minwidth(widget), + "min_width": minwidth, "align": self._theme.align(widget), "instance": widget.id, "name": module.id,