extract add_suffix() method
This commit is contained in:
parent
4855b1aa0a
commit
beff99888b
1 changed files with 8 additions and 4 deletions
|
@ -367,6 +367,13 @@ class WidgetDrawer(object):
|
||||||
if self._prefix:
|
if self._prefix:
|
||||||
self._full_text = u"{}{}".format(self._prefix, self._full_text)
|
self._full_text = u"{}{}".format(self._prefix, self._full_text)
|
||||||
|
|
||||||
|
def add_suffix(self, widget, padding):
|
||||||
|
"""add suffix to full_text"""
|
||||||
|
self._suffix = self._theme.suffix(widget, padding)
|
||||||
|
|
||||||
|
if self._suffix:
|
||||||
|
self._full_text = u"{}{}".format(self._full_text, self._suffix)
|
||||||
|
|
||||||
def draw(self, widget, module=None, engine=None):
|
def draw(self, widget, module=None, engine=None):
|
||||||
"""
|
"""
|
||||||
Keep the same argument signature as I3BarOutput.draw()
|
Keep the same argument signature as I3BarOutput.draw()
|
||||||
|
@ -392,10 +399,7 @@ class WidgetDrawer(object):
|
||||||
|
|
||||||
self.add_prefix(widget, padding)
|
self.add_prefix(widget, padding)
|
||||||
|
|
||||||
self._suffix = self._theme.suffix(widget, padding)
|
self.add_suffix(widget, padding)
|
||||||
|
|
||||||
if self._suffix:
|
|
||||||
self._full_text = u"{}{}".format(self._full_text, self._suffix)
|
|
||||||
|
|
||||||
width = self._theme.minwidth(widget)
|
width = self._theme.minwidth(widget)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue