Commit graph

549 commits

Author SHA1 Message Date
Tim Culverhouse
fb16eafdb6 vxfw: add Padding widget 2024-11-08 05:55:50 -06:00
Tim Culverhouse
147052b5f2 vxfw: add FlexRow widget 2024-11-08 05:55:50 -06:00
Tim Culverhouse
6941cd831c vxfw: add FlexColumn widget
FlexColumn is similar to a flexbox in HTML/CSS. It is a column that has
flexible height for it's children. It expands to fill the vertical space
2024-11-08 05:55:50 -06:00
Tim Culverhouse
96f5ec2a4e vxfw: add Button widget
Add the Button widget. Button reacts to mouse presses and the "enter"
key when it has focus
2024-11-08 05:55:50 -06:00
Tim Culverhouse
b64fa8c28a vxfw: add Center widget
Center widget centers a child widget within itself
2024-11-08 05:55:50 -06:00
Tim Culverhouse
cec9e5814f vxfw: add fuzzy finder example 2024-11-08 05:55:50 -06:00
Tim Culverhouse
118c5566d7 vxfw(App): fix vaxis import 2024-11-08 05:55:50 -06:00
Tim Culverhouse
de362ed7b6 vxfw: add TextField widget
Add the TextField widget. TextField is a single line user input field.
It supports onChange and onSubmit callbacks
2024-11-08 05:55:50 -06:00
Tim Culverhouse
e00950b800 vxfw: add ListView widget
Add the ListView widget. ListView is a scrollable list of widgets. It
has a cursor and mouse support.
2024-11-08 05:55:50 -06:00
Tim Culverhouse
11a829e140 vxfw: add RichText widget
RichText is a general purpose text layout widget which can have more
than one style. This comes with a small performance penalty compared to
`Text` due to not being able to do the same index operations, however it
does support all of the same features
2024-11-08 05:55:50 -06:00
Tim Culverhouse
b956154159 vxfw: add Text widget
Text widget is a general purpose text layout widget. Includes support
for soft wrapping, ellipsis truncation, and text alignment. A single
style is applied to the entire widget area.
2024-11-08 05:55:50 -06:00
Tim Culverhouse
bad7f9cab2 vxfw: add App runtime
Add the App runtime. App manages the event loop, focus, hit testing,
rendering, and scheduled events.
2024-11-08 05:55:50 -06:00
Tim Culverhouse
7cb04494b3 vxfw: introduce the vaxis framework
This was previously being developed at github.com/rockorager/vtk. I
really liked how it came together, and am moving it into the vaxis repo
piece by piece.
2024-11-08 05:55:50 -06:00
Tim Culverhouse
96f29a5fea window!: allow negative offsets and windows beyond screen
Allow negative offsets to a window. Allow a window to extend any edge of
the screen. Out-of-bounds cells ultimately don't write to the screen
2024-11-08 05:55:50 -06:00
Tim Culverhouse
22e55bdfec test: test Screen, skip TestTty on windows 2024-10-30 14:02:29 -05:00
Tim Culverhouse
6d98437434 core: fix panic handler 2024-10-30 13:14:39 -05:00
Tim Culverhouse
7fa04821c7 core: reset cursor and sgr in resetState
Move code to reset cursor and sgr state into `resetState` from `deinit`.

Fixes: #98
2024-10-30 11:40:40 -05:00
Tim Culverhouse
a228e3ea9b tty: move tty impls to common file 2024-10-30 11:15:35 -05:00
Tim Culverhouse
41a6de5f8c build: remove all build_options references 2024-10-30 11:05:03 -05:00
Tim Culverhouse
f1cad6da59 build!: make zigimg a required dependency
Require zigimg as a dependency. Remove build_options module, since we
have no more build options.
2024-10-30 10:49:06 -05:00
Tim Culverhouse
aaf1bb4784 core!: move libxev and zig-aio event loops to USAGE.md
Create USAGE.md to serve as a friendly guide for usage.

Move the libxev and zig-aio event loops to serve as an example of how to
implement a custom event loop in USAGE.md. Remove dependency on these
libraries and all associated examples and source code.

The motivation for this change is to provide a simpler library. The
power to create a custom event loop will always be kept, however the
support burden of maintaining three event loops is not where I want to
focus my energy. The code is small enough that it's easy enough to be
copy/pasted into a project or provided as a third-party library.
2024-10-30 10:38:25 -05:00
Tim Culverhouse
e29aca6b70 build: remove lint step
This step was unused. It was a format check step, but we instead run zig
fmt --check
2024-10-30 06:40:04 -05:00
Tim Culverhouse
9f1de42e8d tty: add test tty
This TestTTY is only valid on posix, for now. To get windows support we
will need to do a pipe or something on windows
2024-10-30 06:38:42 -05:00
Tim Culverhouse
0fd3f70ef1 zig fmt 2024-10-30 06:36:14 -05:00
Justin Braben
7df8ca616a
Add new alignment widgets (#96)
* Add new alignment widgets

* width and height now ?u16. (The limit does not exist!)
2024-10-23 11:06:48 -05:00
Tim Culverhouse
207103e652 window!: use nullable width and height
Use a nullable width and height when creating a child window

Fixes: #84
2024-10-21 11:51:25 -05:00
Tim Culverhouse
70238897bc all!: reduce usage of usize 2024-10-21 11:21:12 -05:00
Tim Culverhouse
cde1edf39d widgets!: remove border widget
The border widget functionality is replicated in Window.child
2024-10-21 10:21:45 -05:00
Danylo Kondratiev
142131595a widgets.TextView: add intCast 2024-10-16 15:40:55 -05:00
Tim Culverhouse
f01e29ce5c zg: remove grapheme_data init
WidthData already includes grapheme_data. We were double allocating it!
2024-10-14 20:06:06 -05:00
Tim Culverhouse
802b40bdd1 vaxis: remove render stats 2024-10-14 20:01:11 -05:00
Tim Culverhouse
313096c277 window: make print infallible
Print and PrintSegment are now infallible due to gwidth also being
infallible. The previous error was only error.OutOfMemory if a temporary
buffer was too small to encode text in gwidth. This has been removed in
favor or a for loop
2024-10-14 19:24:48 -05:00
Tim Culverhouse
dae0380d65 widget(Table): replace iniChild call 2024-10-14 19:17:51 -05:00
Tim Culverhouse
6d95ab65e6 example(main): fix initChild call 2024-10-14 19:16:25 -05:00
Tim Culverhouse
889b57d7e3 widgets(alignment): replace initChild call 2024-10-14 19:14:51 -05:00
Tim Culverhouse
5f9849363a window!: make initChild private 2024-10-14 18:37:18 -05:00
Tim Culverhouse
ab2b356a1f widget(CodeView): fix int type 2024-10-14 18:28:04 -05:00
Tim Culverhouse
142225a48c cell: change width type from usize to u8
Cell is an often used structure, this should come with some decent
memory savings since there are cells stored twice (Screen and
InternalScreen).
2024-10-14 18:27:16 -05:00
Shem Sedrick
2094e0c364 Adding saturating subtraction for w 2024-10-12 15:59:11 -05:00
Tim Culverhouse
306acc7a2e tty(posix): remove signal handler when we have in-band-resize 2024-10-11 12:11:10 -05:00
Tim Culverhouse
ea5726b1d1 gwidth: use an iterator to prevent returning error
This is a breaking change to gwidth: we no longer return an error
2024-10-08 12:14:26 -05:00
Tim Culverhouse
e3062d62b6 view: move to widgets 2024-10-04 20:13:54 -05:00
Tim Culverhouse
eee2e12644 fixup! examples(view): update view example 2024-10-04 20:13:54 -05:00
Tim Culverhouse
f3c81292b1 examples(view): update view example 2024-10-04 20:13:54 -05:00
Tim Culverhouse
a426b5c96e screen: add error union to return type 2024-10-04 20:13:54 -05:00
Tim Culverhouse
4d5f037e22 view: add draw method, modify allocations 2024-10-04 20:13:54 -05:00
00JCIV00
9615a41d1e widgets(table): zig fmt 2024-10-04 20:13:54 -05:00
00JCIV00
94e28654f9 fix(view): zig fmt on fixes 2024-10-04 20:13:54 -05:00
00JCIV00
0dbd72ef99 fix(view): fixed several items from PR #82 review
- Removed Window allocation in `init()`.
- Changed `max_width` and `max_height` to `width` and `height` in `Config`.
- Removed `x_pixel` and `y_pixel` from `Config`.
- Changed the `win` parameter of `toWin()` to Type `Window`.
- Fixed a typo in `fill()` so that it's no longer a recursion trap.
- Updated the example w/ corresponding fixes.
2024-10-04 20:13:54 -05:00
00JCIV00
ac9839c71d widgets(table): implemented header and column borders
- Added the `header_border` and `col_border` to `TableContext`. Note, row borders don't work as well due to borders taking up an entire cell.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00