aboutsummaryrefslogtreecommitdiff
path: root/app/ui/tui.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-24 04:53:43 -0400
committerhistoria <historiavg@proton.me>2026-08-24 04:53:43 -0400
commit0512a932bbf3b87619b6a250f87eb7904d22d1f7 (patch)
treedd2b0eb45823c0690ad2bc86f5aa9be2771f5b17 /app/ui/tui.py
parent9fb2434dcc8a1ed7bd085b453859d473de64448a (diff)
downloadtts-audiobook-generator-0512a932bbf3b87619b6a250f87eb7904d22d1f7.tar.gz
feat: hide convert/config/start-stop menus if no valid installation
Diffstat (limited to 'app/ui/tui.py')
-rw-r--r--app/ui/tui.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/ui/tui.py b/app/ui/tui.py
index 7b6c740..bf17f7d 100644
--- a/app/ui/tui.py
+++ b/app/ui/tui.py
@@ -78,9 +78,10 @@ def flash(scr, text: str, kind: str = "warn") -> None:
"""Show a one-line notice until any key is pressed, then return.
Used by the hub for "not set up yet"-style messages. KIND is a theme
- key (warn/err/ok/info). Esc dismisses the notice (it does not abort).
+ key (warn/err/ok/info). The notice itself is the dialog's only
+ content (no "Notice" heading); Esc dismisses it (it does not abort).
"""
- frame = Frame(scr, "Notice", "Press any key to continue Esc = back")
+ frame = Frame(scr, "", "Press any key to continue Esc = back")
frame.mark(text, frame.theme.get(kind, frame.theme["body"]))
frame.cursor = None
frame.draw()
@@ -378,9 +379,10 @@ class Frame:
inner_x = x0 + 1
inner_w = dialog_w - 2
- title = _fit(f" {self.title} ", inner_w)
- _addstr(scr, y0 + 1, inner_x + max(0, (inner_w - len(title)) // 2),
- title, theme["title"])
+ if self.title:
+ title = _fit(f" {self.title} ", inner_w)
+ _addstr(scr, y0 + 1, inner_x + max(0, (inner_w - len(title)) // 2),
+ title, theme["title"])
if total_lines > visible:
indicator = f" {self.scroll + 1}/{total_lines} "
_addstr(scr, y0, max(x0 + 1, x0 + dialog_w - 1 - len(indicator)),