[core] replace widget.minwidth with widget.set('theme.minwidth')
This commit is contained in:
parent
b841ba3c93
commit
47e8d5b82b
4 changed files with 3 additions and 5 deletions
|
@ -8,7 +8,7 @@ def scrollable(func):
|
|||
return text
|
||||
width = widget.get('theme.width', util.format.asint(module.parameter('width', 30)))
|
||||
if util.format.asbool(module.parameter('scrolling.makewide', True)):
|
||||
widget.minwidth = 'A'*width
|
||||
widget.set('theme.minwidth', 'A'*width)
|
||||
if width < 0 or len(text) <= width:
|
||||
return text
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class i3(object):
|
|||
'full_text': self.__decorate(module, widget, text),
|
||||
'color': self._theme.fg(widget),
|
||||
'background': self._theme.bg(widget),
|
||||
'min_width': self.__decorate(module, widget, widget.minwidth),
|
||||
'min_width': self.__decorate(module, widget, widget.get('theme.minwidth')),
|
||||
})
|
||||
return [attr]
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ class Widget(util.store.Store, core.input.Object):
|
|||
self._module = module
|
||||
self._name = name
|
||||
|
||||
self.minwidth = None
|
||||
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import core.input
|
|||
class Module(core.module.Module):
|
||||
def __init__(self, config=None):
|
||||
super().__init__(config, core.widget.Widget(self.utilization))
|
||||
self.widget().minwidth = self._format.format(100.0-10e-20)
|
||||
self.widget().set('theme.minwidth', self._format.format(100.0-10e-20))
|
||||
self._utilization = psutil.cpu_percent(percpu=False)
|
||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||
cmd='gnome-system-monitor')
|
||||
|
|
Loading…
Reference in a new issue