diff options
Diffstat (limited to 'app/ui/tui.py')
| -rw-r--r-- | app/ui/tui.py | 12 |
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)), |
