- Added the `header_align` and `col_align` to `TableContext` along with the corresponding `HorizontalAlignment` and `ColumnAlignment` Types.
- Updated the `table.zig` example.
- Set up swapable Views for a Small and Large map.
- Created a "Controls" Window at the top of the TUI.
- Added better documentation for how Views work.
- Added proper bounds checking to fit the View within the provided Window.
- Added a simple x/y return Type to the `toWin()` function so users can more easily maintain scrolling bounds.
- Implemented View as an easy way to use the existing Screen and Window APIs for rendering Cells that don't fit within a Window. Basically, a user renders the oversized Cell content to a View, then renders a part of that View to a Window.
- Created the `view.zig` example.
- Changed the behavior of `ColumnIndexes.by_idx` (used f/ `TableContext.col_indexes`) to allow valid field indexes in any order. Indexes can also be removed or added multiple times to affect the table generation accordingly.
Attempt to reset the cursor shape on exit, if the shape has been
changed. This won't work on every terminal, however some implement
`\x1b[0 q` as setting the shape to the "default" value, others implement
it as a blinking block.
Fixes: #77
- Added the `HeaderNames` Type and `header_names` field to `TableContext` to let users choose between automatically getting header names from fields or setting custom names.
- Removed the `headers` parameter from `drawTable()`.
- Added the `ColumnIndexes` Type and `col_indexes` field to `TableContext` to let users choose which columns/fields they actually want to display.
- Added `active_content_fn` as an optional callback function that can be provided to `TableContext` to vertically expand the active row with additional info.
- Added `active_ctx` and `active_y_off` to support the `active_content_fn`.
- Updated the Table Widget example with
- Added the `WidthStyle` union to the Table Widget. This allows users to choose from 4 different options for Column Widths.
- Updated the Table Example with demos of the various styles (via comments).
- Implemented `TableContext.sel_rows`, allowing users to specify which rows have been 'selected' (similar to ctrl+clicking items in a GUI file browser).
- Changed previous 'selected' verbiage to 'active' in all cases.
- Added `loop.init()` to regain dynamic resizing. (Thanks @rockorager!)
- Used the TTY's Buffered Writer where applicable.
- Updated `win.initChild()` to `win.child()` in all cases.
- Improved ArenaAllocator usage.
Add a prettyPrint function which dumps the current screen to the tty,
not saving any state. This is useful for pretty printing text to stdout
in a streaming fashion
When drawing on the primary screen The internal state of the cursor
location was not being updated. This resulted in an invalid state and a
messed up screen
Fixes: https://github.com/rockorager/libvaxis/issues/63