diff options
| author | historia <historiavg@proton.me> | 2026-08-25 16:40:30 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-25 16:40:30 -0400 |
| commit | 867866f131b0b6c76c54272791e7f7dea01db990 (patch) | |
| tree | b57ecdd66eeaf7ad73742d2f2bbe15d3a5498fa3 /app/ui/tui.py | |
| parent | fca3431721a55277f139efc83df2438207917448 (diff) | |
| download | tts-audiobook-generator-867866f131b0b6c76c54272791e7f7dea01db990.tar.gz | |
feat: better tui menu option gating for models that support custom voices (qwen) and models that do not support instructions
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"]) |
