parent
4baf63f88c
commit
fa30b9505b
4 changed files with 10 additions and 2 deletions
|
@ -19,6 +19,7 @@ class Widget(object):
|
|||
self.module = module.name
|
||||
|
||||
def state(self):
|
||||
"""Return the widget's state"""
|
||||
return "state-default"
|
||||
|
||||
def full_text(self):
|
||||
|
|
|
@ -17,6 +17,9 @@ class Theme(object):
|
|||
def __init__(self, name):
|
||||
self._init(self.load(name))
|
||||
self._widget = None
|
||||
self._cycle_idx = 0
|
||||
self._cycle = {}
|
||||
self._prevbg = None
|
||||
|
||||
def _init(self, data):
|
||||
"""Initialize theme from data structure"""
|
||||
|
@ -67,9 +70,11 @@ class Theme(object):
|
|||
return self._get(widget, "separator", None)
|
||||
|
||||
def separator_fg(self, widget):
|
||||
"""Return the separator's foreground/text color"""
|
||||
return self.bg(widget)
|
||||
|
||||
def separator_bg(self, widget):
|
||||
"""Return the separator's background color"""
|
||||
return self._prevbg
|
||||
|
||||
def separator_block_width(self, widget):
|
||||
|
|
|
@ -82,11 +82,12 @@ class TestTheme(unittest.TestCase):
|
|||
theme = self.theme
|
||||
data = theme.data()
|
||||
|
||||
self.assertEquals(theme.separator_block_width(self.anyWidget), data["defaults"]["separator-block-width"])
|
||||
self.assertEquals(theme.separator_block_width(self.anyWidget),
|
||||
data["defaults"]["separator-block-width"]
|
||||
)
|
||||
|
||||
def test_separator(self):
|
||||
for theme in [self.theme, self.cycleTheme]:
|
||||
data = theme.data()
|
||||
theme.reset()
|
||||
prev_bg = theme.bg(self.anyWidget)
|
||||
theme.bg(self.anotherWidget)
|
||||
|
|
|
@ -30,6 +30,7 @@ class MockOutput(object):
|
|||
|
||||
class MockWidget(Widget):
|
||||
def __init__(self, text):
|
||||
super(MockWidget, self).__init__(text)
|
||||
self._text = text
|
||||
self.module = None
|
||||
self.attr_state = "state-default"
|
||||
|
|
Loading…
Reference in a new issue