Commit graph

549 commits

Author SHA1 Message Date
00JCIV00
46ecd65c0c widgets(table): implemented header and column alignment
- Added the `header_align` and `col_align` to `TableContext` along with the corresponding `HorizontalAlignment` and `ColumnAlignment` Types.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
ad12308a1c view: zig formatted 2024-10-04 20:13:54 -05:00
00JCIV00
28f5734840 view: added 'child()' to View and improved example comments 2024-10-04 20:13:54 -05:00
00JCIV00
d2c9f6337d example(view): made the example more feauture complete and user friendly
- 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.
2024-10-04 20:13:54 -05:00
00JCIV00
a7fcbe2d73 view: continued initial implementation
- 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.
2024-10-04 20:13:54 -05:00
00JCIV00
94bec1ec2a view: implemented an easy mechanism for vertical and horizontal scrolling
- 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.
2024-10-04 20:13:54 -05:00
Tim Culverhouse
a1b43d2465 core: reset sgr on deinit, and at the end of prettyPrint
Reset SGR unilaterally when deiniting vaxis. Also reset it at the end of
a prettyPrint render.
2024-09-30 10:53:23 -05:00
Jeffrey C. Ollie
1961712c1f TextInput: add ability to draw widget with a style 2024-09-25 11:10:12 -05:00
Jeffrey C. Ollie
2cc1eb77f8 subscribeToColorSchemeUpdates needs a mutable reference 2024-09-23 16:29:42 -05:00
00JCIV00
c89b75ebe3 widgets(table): added ability to reorder and duplicate columns
- 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.
2024-09-12 21:07:41 -05:00
00JCIV00
eaa9c1580a widgets(table): fixed an issue w/ active row contents causing the last few rows to disappear 2024-09-12 21:07:41 -05:00
00JCIV00
2580a8fc12 widgets(table): improved type and bounds checks
- Improved the Type checks for MultiArrayList child Types.
- Improved the bounds checking for printing rows.
2024-09-12 21:07:41 -05:00
00JCIV00
a17c4af217 widgets(table): implemented customizable x offset for cells/items
- Added `cell_x_off` to the `TableContext` to allow changing the X Offset of Cells/Items as they're printed to their rows.
2024-09-12 21:07:41 -05:00
00JCIV00
dbeef72630 widgets(table): implemented customizable foreground colors
- Added `active_fg` and `selected_fg` to allow changing the Foreground Color of Active and Selected rows (and Headers) respectively.
2024-09-12 21:07:41 -05:00
Tim Culverhouse
235e0bb27b vaxis: attempt to reset cursor shape
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
2024-09-10 09:22:42 -05:00
Tim Culverhouse
8263b1e35c widgets(terminal): change pts log to debug
Change an error log of the pts name to be a debug level.
2024-09-05 06:24:24 -05:00
Tim Culverhouse
fa485c740c quirks: set legacy sgr for TERM_PROGRAM=vscode 2024-09-04 04:19:57 -05:00
Tim Culverhouse
e1e3c61cdf osc7: use std.Uri for percent encoding 2024-08-30 06:47:57 -05:00
CJ van den Berg
7dde40d346 fix(windows): don't use getenv("HOSTNAME") on windows 2024-08-30 06:47:57 -05:00
CJ van den Berg
e4655a4ab4 feat: add setTerminalWorkingDirectory (OSC7) 2024-08-30 06:47:57 -05:00
Tim Culverhouse
fcdeb321fe zig fmt 2024-08-15 19:38:14 -05:00
00JCIV00
500488f728 widgets(table): implemented more header and column options
- 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.
2024-08-15 19:37:16 -05:00
00JCIV00
d1b4e3f010 widgets(table): added support f/ enums and slices of strings
- Added proper printing f/ Enums and Slices of Strings into Table cells.
2024-08-15 19:37:16 -05:00
Tim Culverhouse
26072bd85e main: fix test import 2024-08-13 07:45:39 -05:00
Tim Culverhouse
327c2ace82 zig fmt 2024-08-13 07:42:14 -05:00
Tim Culverhouse
54e15764c4 example(table): fix text_input api 2024-08-13 07:42:14 -05:00
00JCIV00
81387ff242 git(fixes): fixed small issue with git rebase
- Reimplemented `col_width` in the Table Widget.
- Readded `*.sw?` to gitignore.
2024-08-13 07:42:14 -05:00
00JCIV00
ca6a67f689 window(fill) bounds check for start and end positions in both conditions 2024-08-13 07:42:14 -05:00
00JCIV00
999b0f4f00 widgets(table): implemented optional active row contents callback & context
- 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
2024-08-13 07:42:14 -05:00
00JCIV00
a99fd3c29f widgets(table): implemented customizable column widths
- 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).
2024-08-13 07:42:14 -05:00
00JCIV00
bbbfbaffbb widgets(table): implemented selectable rows
- 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.
2024-08-13 07:42:14 -05:00
00JCIV00
5972da8ee3 examples(table): updated the table example w/ latest vaxis changes
- 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.
2024-08-13 07:42:14 -05:00
00JCIV00
9487916406 widgets(table): add support for Slices and MultiArrayLists
- Updated the Table Widget to support Slices and MultiArrayLists (in addtion to ArrayLists) for the `data_list` parameter of `drawTable()`.
2024-08-13 07:42:14 -05:00
Tim Culverhouse
707c050a76 widgets(text_input): add realLength fn
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:18:12 -05:00
Tim Culverhouse
453203553e widgets(text_input): expose api
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:10:45 -05:00
Tim Culverhouse
62ccf824cf widgets(text_input): impl word motion and deletes
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:07:09 -05:00
Tim Culverhouse
4fbbebbf0c widgets(text_input): use internal GapBuffer impl
Use a tiny GapBuffer implementation internal to the library.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 20:19:23 -05:00
CJ van den Berg
7190fde166 feat: add functions to set the default terminal background/foreground
And reset to default on cleanup.
2024-08-12 17:25:40 -05:00
Tim Culverhouse
a8baf9ce37 feat: add prettyPrint
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
2024-08-06 12:10:03 -05:00
Tim Culverhouse
22516a971c image: reverse order of transmitLocalImagePath args
Width *then* height
2024-08-05 10:16:52 -05:00
Tim Culverhouse
0064229635 image: implement local filesystem transmission
Implement transmission over a local filesystem, by file, temp file, or
shared mem.
2024-08-05 07:58:04 -05:00
Tim Culverhouse
ec09912fa8 window(fill): bounds check end condition for fill
Fixes #65
2024-08-02 07:30:02 -05:00
glyh
9cbcc92b4c fix memleak with transmitted image 2024-08-01 21:17:23 -05:00
Tim Culverhouse
2f46eb9172 examples(table): add intrusive init on Loop 2024-07-30 18:24:37 -05:00
Tristan Partin
e44c578649 Add home and end keybinds for the TextInput widget
readline accepts these an analogs for ctrl+z and ctrl+e.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-07-30 14:03:09 -05:00
Tim Culverhouse
138604313e update readme 2024-07-30 13:53:13 -05:00
Tim Culverhouse
d36ab043ca render: reset osc8 link on reposition
Reset the link state on reposition so we properly write a new OSC8 tag
2024-07-29 19:09:31 -05:00
CJ van den Berg
5b7f2c3d5d fix: panic invalid enum value on left or right scroll 2024-07-28 15:49:43 -05:00
Tim Culverhouse
f0eaa3c831 resize: properly handle state reset on primary screen
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
2024-07-21 21:17:00 -05:00
Tim Culverhouse
81a6b373a0 image: add transmitPreEncodedImage method
Add a method that allows users of the library to pre-encode an image
using whichever base64 encoder they want (ie a simd encoder).
2024-07-20 15:51:03 -05:00