Skip to content

Commit

Permalink
Background: fixed toggling when UI is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
ok100 committed Sep 27, 2014
1 parent 95a7d36 commit 4247d02
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lyvi/tui.py
Expand Up @@ -144,9 +144,8 @@ def header(self):
@header.setter
def header(self, value):
self._header = value
if not self.hidden:
self.head.set_text(('header', self.header))
self._refresh()
self.head.set_text(('header', self.header if not self.hidden else ''))
self._refresh()

@property
def text(self):
Expand All @@ -156,10 +155,11 @@ def text(self):
@text.setter
def text(self, value):
self._text = value
if not self.hidden:
lines = [urwid.Text(('content', line)) for line in self.text.splitlines()]
self.content[:] = [self.head, urwid.Divider()] + lines
self._refresh()
lines = []
for line in self.text.splitlines():
lines.append(urwid.Text(('content', line if not self.hidden else '')))
self.content[:] = [self.head, urwid.Divider()] + lines
self._refresh()

def init(self):
"""Initialize the class."""
Expand Down

0 comments on commit 4247d02

Please sign in to comment.