aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/table.go
Commit message (Collapse)AuthorAgeFilesLines
* vaxis: update to v0.7.2 and update ansi parserTim Culverhouse2024-02-121-16/+18
| | | | | | | | | | | | Update Vaxis to v0.7.2 to gain performance improvements and StyledString parsing. The Vaxis parser fully accounts for the terminal's capability to display wide characters. Use the Vaxis StyledString parser to parse and style ansi-encoded strings. Remove unneeded code and tests. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* style: use vaxis style everywhereTim Culverhouse2024-02-121-9/+9
| | | | | | | Replace all tcell.Style objects with vaxis.Style objects Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* table: fix center paddingRobin Jarry2023-03-041-11/+5
| | | | | | | | | | | When a column has ALIGN_CENTER and the number of white space character of padding is not a multiple of two, the last cell(character) is not padded and that can cause coloring glitches. Make sure to pad all the way. Fixes: 49de9b09cacc ("ui: parse strings for ansi styles") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* ui: parse strings for ansi stylesTim Culverhouse2023-03-021-14/+27
| | | | | | | | | Parse UI strings for ANSI styles. If there are styles in the string, use those as the display style in tcell. This is in preparation for a template function which can apply arbitrary styles to UI elements. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui/table: do not require width at constructionRobin Jarry2023-02-201-8/+6
| | | | | | | | | The width is only required when rendering the table in Draw. Remove the redundant width attribute. Fixes: 012be0192c88 ("ui: add reusable table widget") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* ui/table: allow zero width columnsRobin Jarry2023-02-201-4/+7
| | | | | | | | | | | | | When a column uses WIDTH_FIT and its contents are empty, the column is not rendered at all, neither is its separator. This can cause display artifacts (interruption of background color, etc.). Make sure to differentiate between zero-width columns and columns that overflow screen width. Fixes: 012be0192c88 ("ui: add reusable table widget") Acked-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* ui: add reusable table widgetRobin Jarry2023-01-041-0/+210
This will be used by the message list index and by the status line. A table is constructed from rows/width dimensions, a list of column definitions and a column separator. Provide functions to parse column definitions from ini config files. This will be used in the next commit. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>