mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 06:44:00 -06:00
ui/curses: add scrollbars
This commit is contained in:
@@ -44,9 +44,8 @@ class DataTable(Scrollable):
|
||||
return idx
|
||||
return None
|
||||
|
||||
def _render_impl(self) -> None:
|
||||
def _render_impl(self, h: int, w: int) -> None:
|
||||
assert self._pad
|
||||
h, w = self.getmaxyx()
|
||||
if self._align_right:
|
||||
for y, row in enumerate(self._items):
|
||||
self._pad.move(y, 0)
|
||||
@@ -64,8 +63,5 @@ class DataTable(Scrollable):
|
||||
y, col2_x, row[1], min(len(row[1]), w - col2_x)
|
||||
)
|
||||
|
||||
y, x = self.getbegyx()
|
||||
self._pad.refresh(self._scroll_y, 0, y, x, y + h - 1, x + w - 1)
|
||||
|
||||
def _get_col_width(self, x: int) -> int:
|
||||
return max([len(row[0]) for row in self._items] + [0])
|
||||
|
||||
Reference in New Issue
Block a user