mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 06:44:00 -06:00
ui/curses: remove flickering
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user