diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-23 09:13:17 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-23 09:13:17 +0200 |
| commit | 53071bb69f5d21b35b8a61c2b1dd18832ce781d4 (patch) | |
| tree | fa76c13cef78925d1b9650e92f64d5115dcdb6e7 /clients/tui.c | |
| parent | 2ca284619125af0d5c12e9210ff1bfc8f9122739 (diff) | |
| download | bokf-53071bb69f5d21b35b8a61c2b1dd18832ce781d4.tar.gz bokf-53071bb69f5d21b35b8a61c2b1dd18832ce781d4.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'clients/tui.c')
| -rw-r--r-- | clients/tui.c | 14 |
1 files changed, 9 insertions, 5 deletions
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) |
