aboutsummaryrefslogtreecommitdiff
path: root/clients/tui.c
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-19 23:27:03 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-19 23:27:03 +0200
commit86c0ef0e30f6cb24db04f20a326cf5fb4b616c3c (patch)
treeb54766feb1a19b41b9f16c086d89c2f47d35dafc /clients/tui.c
parent985ae80d7f82cef7c273fae953c73f8bd909ebef (diff)
downloadbokf-0.1.42.tar.gz
bokf-0.1.42.zip
tui: bokslut footer explains the plan/post keysv0.1.42
Diffstat (limited to 'clients/tui.c')
-rw-r--r--clients/tui.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/clients/tui.c b/clients/tui.c
index 8f410c2..a964f65 100644
--- a/clients/tui.c
+++ b/clients/tui.c
@@ -1145,9 +1145,15 @@ int tui_menu(const char *title, const char *const *items, int n,
/* frame, status and hints */
/* ------------------------------------------------------------------ */
+static const char *g_form_hint;
static char g_status[512];
static char g_right[160];
+void tui_form_hint(const char *hint)
+{
+ g_form_hint = hint;
+}
+
void tui_set_status(const char *status, const char *right)
{
snprintf(g_status, sizeof g_status, "%s", status ? status : "");
@@ -1390,11 +1396,16 @@ int tui_form_run_hook(const char *title, struct tui_form_field *f, int n,
else if (!can_edit)
attroff(tui_style_attrs(TUI_DIM, g_colours, 0));
}
- tui_hints(can_edit
- ? "upp/ned Enter = ändra F5 = uppdatera"
- " ^Enter = spara Esc/q = tillbaka ^C = avsluta"
- : "upp/ned F5 = uppdatera Esc/q = tillbaka"
- " ^C = avsluta (endast behöriga kan ändra)");
+ tui_hints(g_form_hint
+ ? g_form_hint
+ : (can_edit
+ ? "upp/ned/Home/End Enter = ändra"
+ " F5 = uppdatera ^Enter = spara"
+ " Esc/q = tillbaka ^C = avsluta"
+ : "upp/ned/Home/End F5 = uppdatera"
+ " Esc/q = tillbaka ^C = avsluta"
+ " (endast behöriga kan ändra)"));
+ g_form_hint = NULL;
refresh();
int ch = in_key();
int nxt = tui_form_next(sel, n, ch);