[core] Add a "scrollable" modifier for widget texts callbacks

If a module defines a callback for a widget's text, an optional
decorator "@bumblebee.output.scrollable" can be used to make the text
scrollable.

In those cases, the desired width is set to (in decreasing order of
priority):
1. whatever the widget defines as "theme.width"
2. whatever the theme defines as "width" for the module
3. whatever the commandline parameter "width" for the module is set to
4. 30 (determined by unfair dice roll)

see #27
This commit is contained in:
Tobias Witek 2017-04-22 13:07:50 +02:00
parent 92be7d3020
commit 928940d848
2 changed files with 24 additions and 2 deletions

View file

@ -139,7 +139,7 @@ class Theme(object):
state_themes.append(self._get(widget, state, {}))
value = self._defaults.get(name, default)
value = widget.get("theme-{}".format(name), value)
value = widget.get("theme.{}".format(name), value)
value = self._cycle.get(name, value)
value = module_theme.get(name, value)