diff options
Diffstat (limited to 'app/ui/tui.py')
| -rw-r--r-- | app/ui/tui.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/ui/tui.py b/app/ui/tui.py index 663df0a..d675946 100644 --- a/app/ui/tui.py +++ b/app/ui/tui.py @@ -373,7 +373,10 @@ class Frame: Returns (y0, x0, dialog_h, visible); also refreshes self.scroll and self.page_size. """ - chrome = 7 if self.buttons else 6 # title/gap/status/footer/borders + # Borders, title, status and footer are fixed chrome; a titled + # frame also reserves a blank line below its title, and buttons + # take their own row above the status. + chrome = 6 + (1 if self.title else 0) + (1 if self.buttons else 0) dialog_h = min(max(self.MIN_HEIGHT, len(flat) + chrome), height) visible = max(1, dialog_h - chrome) self.page_size = max(1, visible) @@ -447,7 +450,7 @@ class Frame: inner_w = dialog_w - 2 for line in range(self.scroll, min(len(flat), self.scroll + visible)): logical, row, piece = flat[line] - y = y0 + 2 + (line - self.scroll) + y = y0 + (3 if self.title else 2) + (line - self.scroll) selected = logical == self.cursor and row["selectable"] if selected: _addstr(scr, y, inner_x, " " * inner_w, theme["bar"]) |
