diff -r 0c2e0c09ba5c -r 105b1affc3c2 tuikit/widgets/button.py --- a/tuikit/widgets/button.py Fri Mar 28 19:58:59 2014 +0100 +++ b/tuikit/widgets/button.py Wed Sep 03 19:08:21 2014 +0200 @@ -9,6 +9,7 @@ def __init__(self, label='btn'): """Create button with given label, size according to label.""" Widget.__init__(self) + self.allow_focus = True #: Button label. self._label = '' @@ -21,10 +22,8 @@ #: Padding between prefix/suffix and label self.padding = 1 - self.allow_focus = True - self.color = 'default' - self.color_highlighted = 'default on red' + self.color_active = 'default on red' self.highlight = False self.sig_clicked = Signal() @@ -45,11 +44,11 @@ def set_theme(self, theme): Widget.set_theme(self, theme) self.color = theme.button - self.color_highlighted = theme.button_active + self.color_active = theme.button_active def _get_color(self): - if self.highlight: # or self.has_focus(): - return self.color_highlighted + if self.has_focus(): + return self.color_active return self.color def draw(self, buffer):