diff options
author | mathieui <mathieui@mathieui.net> | 2011-12-28 23:32:23 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-01-26 10:05:35 +0100 |
commit | 765f1807a9c67894712fd680de6e6de6deddf808 (patch) | |
tree | cb48234ae479fdaef321da044db8e9128be727df /src | |
parent | adf3cfe6947ab9d6f6465b4f3564e142ffb1f6a0 (diff) | |
download | poezio-765f1807a9c67894712fd680de6e6de6deddf808.tar.gz poezio-765f1807a9c67894712fd680de6e6de6deddf808.tar.bz2 poezio-765f1807a9c67894712fd680de6e6de6deddf808.tar.xz poezio-765f1807a9c67894712fd680de6e6de6deddf808.zip |
Fix various issues with the /configure tab
Vertical tab list, text not erased from previous tab
Diffstat (limited to 'src')
-rw-r--r-- | src/data_forms.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/data_forms.py b/src/data_forms.py index 2d17a304..d4a8697a 100644 --- a/src/data_forms.py +++ b/src/data_forms.py @@ -75,7 +75,7 @@ class DataFormsTab(Tab): def refresh(self): self.topic_win.refresh(self._form['title']) - self.tab_win.refresh() + self.refresh_tab_win() self.help_win.refresh() self.help_win_dyn.refresh(self.form_win.get_help_message()) self.form_win.refresh() @@ -88,7 +88,7 @@ class FieldInput(object): """ def __init__(self, field): self._field = field - self.color = (14, -1) + self.color = get_theme().COLOR_NORMAL_TEXT def set_color(self, color): self.color = color @@ -131,6 +131,7 @@ class ColoredLabel(windows.Win): def refresh(self): with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addstr(0, 0, self.text) self._win.attroff(to_curses_attr(self.color)) @@ -157,7 +158,7 @@ class DummyInput(FieldInput, windows.Win): class ColoredLabel(windows.Win): def __init__(self, text): self.text = text - self.color = (14, -1) + self.color = get_theme().COLOR_NORMAL_TEXT windows.Win.__init__(self) def resize(self, height, width, y, x): @@ -169,6 +170,7 @@ class ColoredLabel(windows.Win): def refresh(self): with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addstr(0, 0, self.text) self._win.attroff(to_curses_attr(self.color)) @@ -189,6 +191,7 @@ class BooleanWin(FieldInput, windows.Win): def refresh(self): with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addnstr(0, 0, ' '*(8), self.width) self.addstr(0, 2, "%s"%self.value) @@ -253,6 +256,7 @@ class TextMultiWin(FieldInput, windows.Win): def refresh(self): if not self.edition_input: with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addnstr(0, 0, ' '*self.width, self.width) option = self.options[self.val_pos] @@ -305,6 +309,7 @@ class ListMultiWin(FieldInput, windows.Win): def refresh(self): with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addnstr(0, 0, ' '*self.width, self.width) if self.val_pos > 0: @@ -351,6 +356,7 @@ class ListSingleWin(FieldInput, windows.Win): def refresh(self): with g_lock: + self._win.erase() self._win.attron(to_curses_attr(self.color)) self.addnstr(0, 0, ' '*self.width, self.width) if self.val_pos > 0: @@ -377,7 +383,7 @@ class TextSingleWin(FieldInput, windows.Input): self.text = field.getValue() if isinstance(field.getValue(), str)\ else "" self.pos = len(self.text) - self.color = (14, -1) + self.color = get_theme().COLOR_NORMAL_TEXT def reply(self): self._field['label'] = '' @@ -427,7 +433,7 @@ class FormWin(object): } def __init__(self, form, height, width, y, x): self._form = form - self._win = curses.newwin(height, width, y, x) + self._win = windows.Win._tab_win.derwin(height, width, y, x) self.current_input = 0 self.inputs = [] # dict list for (name, field) in self._form.getFields().items(): |