Commit 4330421b authored by Jacek Sowiński's avatar Jacek Sowiński

Redraw the screen in more elegant way after 'e'

Thanks to @bram85 for the idea.
parent 85808815
......@@ -258,6 +258,7 @@ class UIApplication(CLIApplicationBase):
no_output = lambda _: None
urwid.connect_signal(todolist, 'execute_command',
lambda cmd: self._execute_handler(cmd, no_output))
urwid.connect_signal(todolist, 'refresh', self.mainloop.screen.clear)
options = self.columns.options(
width_type='given',
......
......@@ -43,7 +43,7 @@ class TodoListWidget(urwid.LineBox):
super().__init__(pile)
urwid.register_signal(TodoListWidget, ['execute_command'])
urwid.register_signal(TodoListWidget, ['execute_command', 'refresh'])
@property
def view(self):
......@@ -134,7 +134,7 @@ class TodoListWidget(urwid.LineBox):
elif p_key == 'e':
self._edit_selected_item()
# force screen redraw after editing
return self.listbox.keypress(p_size, 'ctrl l')
urwid.emit_signal(self, 'refresh')
elif p_key == 'r':
self.keystate = 'r'
elif p_key == 'u':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment