From 53071bb69f5d21b35b8a61c2b1dd18832ce781d4 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Wed, 23 Sep 2026 09:13:17 +0200 Subject: tui: aligned voucher detail, up/down between vouchers, list sorting The detail pads every column by display width, blanks zero amounts and shows row texts and a Summa line. Up/Down step to the previous/next voucher in the list order; 's' cycles the list sort (number or date, ascending or descending, saved in tui.conf). The list fetches all pages of voucher.list instead of stopping at 200. Co-Authored-By: Claude Opus 5.5 --- clients/tui.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'clients/tui.c') diff --git a/clients/tui.c b/clients/tui.c index 211df40..aa859e2 100644 --- a/clients/tui.c +++ b/clients/tui.c @@ -1410,15 +1410,16 @@ int tui_pager_hook(const char *title, const char *text, pager_line(2 + row, NULL); } char hint[512]; + const char *scroll = (flags & TUI_PAGER_NO_ARROWS) + ? "PgUp/PgDn/Home/End rullar" + : "piltangenter/PgUp/PgDn rullar"; if (extra_hint && *extra_hint) snprintf(hint, sizeof hint, - "piltangenter/PgUp/PgDn rullar F5 = uppdatera %s " - "q = tillbaka", + "%s F5 = uppdatera %s q = tillbaka", scroll, extra_hint); else - snprintf(hint, sizeof hint, - "piltangenter/PgUp/PgDn rullar F5 = uppdatera " - "q = tillbaka"); + snprintf(hint, sizeof hint, "%s F5 = uppdatera q = tillbaka", + scroll); tui_hints(hint); refresh(); int ch = in_key(); @@ -1443,6 +1444,9 @@ int tui_pager_hook(const char *title, const char *text, if (h == TUI_HOOK_STAY) continue; } + if ((flags & TUI_PAGER_NO_ARROWS) && + (ch == KEY_UP || ch == KEY_DOWN)) + continue; if (ch == KEY_DOWN && top + vbody < nb) top++; else if (ch == KEY_UP && top > 0) -- cgit v1.3