[core] Nicify error widget

This commit is contained in:
Tobias Witek 2020-02-23 14:52:58 +01:00
parent 65186baea6
commit 5e673482d3
2 changed files with 7 additions and 2 deletions

View file

@ -11,7 +11,7 @@ def scrollable(func):
if width < 0 or len(text) <= width: if width < 0 or len(text) <= width:
return text return text
bounce = util.format.asint(module.parameter('scrolling.bounce', 1)) bounce = util.format.asbool(module.parameter('scrolling.bounce', True))
scroll_speed = util.format.asint(module.parameter('scrolling.speed', 1)) scroll_speed = util.format.asint(module.parameter('scrolling.speed', 1))
start = widget.get('scrolling.start', -1) start = widget.get('scrolling.start', -1)
direction = widget.get('scrolling.direction', 'right') direction = widget.get('scrolling.direction', 'right')

View file

@ -30,6 +30,9 @@ class Module(core.input.Object):
# TODO retrieve from config file # TODO retrieve from config file
return value return value
def set(self, key, value):
self._config.set('{}.{}'.format(self.name(), key), value)
def update(self): def update(self):
pass pass
@ -48,7 +51,9 @@ class Error(Module):
self._module = module self._module = module
self._error = error self._error = error
self.widgets()[0].set('theme.width', 15) self.set('scrolling.bounce', False)
self.set('scrolling.speed', 2)
self.set('width', 15)
@core.decorators.scrollable @core.decorators.scrollable
def full_text(self, widget): def full_text(self, widget):