ui/curses: remove flickering

This commit is contained in:
rr-
2019-01-04 00:56:55 +01:00
parent ed9e513271
commit 8b38eeecac
11 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class WindowWrapper(Widget):
else:
try:
self._win = parent.derwin(h, w, y, x)
self._win.refresh()
self._win.noutrefresh()
except curses.error:
self._win = None
+1 -1
View File
@@ -7,4 +7,4 @@ class Label(WindowWrapper):
return
self._win.erase()
self._win.addnstr(text, min(len(text), self.getmaxyx()[1] - 1))
self._win.refresh()
self._win.noutrefresh()
+1 -1
View File
@@ -16,4 +16,4 @@ class ProgressBar(WindowWrapper):
self._win.chgat(0, 0, curses.A_REVERSE)
if x < self.getmaxyx()[1]:
self._win.chgat(0, x, curses.A_NORMAL)
self._win.refresh()
self._win.noutrefresh()
+3 -3
View File
@@ -54,15 +54,15 @@ class Scrollable(WindowWrapper):
win_y2 = int(y2 * h // len(self._items))
for win_y in range(win_y1, win_y2):
self._win.chgat(win_y, 0, curses.A_REVERSE)
self._win.refresh()
self._win.noutrefresh()
self._render_impl(h, w - 1)
self._pad.refresh(
self._pad.noutrefresh(
self._scroll_y, 0, y, x, y + h - 1, x + w - 2
)
else:
self._render_impl(h, w)
self._pad.refresh(
self._pad.noutrefresh(
self._scroll_y, 0, y, x, y + h - 1, x + w - 1
)