[core] Make error widget scrollable
Restrict error module to 15 characters and make it scrollable.
This commit is contained in:
parent
a69e058dd1
commit
65186baea6
4 changed files with 8 additions and 4 deletions
|
@ -3,6 +3,7 @@ import logging
|
|||
|
||||
import core.input
|
||||
import core.widget
|
||||
import core.decorators
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -47,7 +48,10 @@ class Error(Module):
|
|||
self._module = module
|
||||
self._error = error
|
||||
|
||||
def full_text(self):
|
||||
self.widgets()[0].set('theme.width', 15)
|
||||
|
||||
@core.decorators.scrollable
|
||||
def full_text(self, widget):
|
||||
return '{}: {}'.format(self._module, self._error)
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
|
@ -11,7 +11,7 @@ class Widget(util.store.Store, core.input.Object):
|
|||
self._full_text = value
|
||||
else:
|
||||
if callable(self._full_text):
|
||||
return self._full_text()
|
||||
return self._full_text(self)
|
||||
return self._full_text
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
|
@ -113,7 +113,7 @@ class Module(core.module.Module):
|
|||
logging.error('no pulseaudio device found')
|
||||
return 'n/a'
|
||||
|
||||
def volume(self):
|
||||
def volume(self, widget):
|
||||
if self._failed == True:
|
||||
return 'n/a'
|
||||
if int(self._mono) > 0:
|
||||
|
|
|
@ -33,7 +33,7 @@ class Module(core.module.Module):
|
|||
def default_format(self):
|
||||
return '%x %X'
|
||||
|
||||
def full_text(self):
|
||||
def full_text(self, widget):
|
||||
enc = locale.getpreferredencoding()
|
||||
retval = datetime.datetime.now().strftime(self._fmt)
|
||||
if hasattr(retval, 'decode'):
|
||||
|
|
Loading…
Reference in a new issue