Skip to content

Conversation

Mishieck
Copy link

libvaxis-border

I added the ability to use custom border graphemes to vxfw.Border. Some commonly used borders such as bold, single, round (which was the one used internally), and many more, have been provided. The property for specifying graphemes (graphemes) was made optional and set to round by default to ensure backward compatibility.

I also added an example to the examples directory to showcase the border graphemes and other border attributes.

neurocyte and others added 15 commits July 23, 2025 13:39
* vxfw(Border): add BorderLabels to Border widget

* - changed enum names to snake_case.
- used Grapheme Iterator instead of old range based loop.
- used `ctx.stringWidth()` instead of `text.len`.
- added empty label guard.

* modified loop to use stringWidth instead of i range

* - Added trailing comma at the end of BorderLabel alignment enum definition.
- Changed from `.width=1` to `.width=width`

* - Added @intcast for width

* fix zig fmt errors
This also fixes the vt example.

Fixes: 58bc3fd ("deps: update zg")
Unicode is not actually used by Screen anyway,
and Vaxis.init cannot return with Vaxis.screen.unicode assigned
as the pointer to Vaxis.unicode could be dangling.

The initial Vaxis without .screen.unicode
makes {Window,widgets.View}.gwidth a footgun.
This prevents reporting kitty mouse leave events as spurious mouse clicks.
- Allow user to specify type of border style.
- Users can use 'bold', 'single', 'round', and other kinds of styles.
- Make this change backwards-compatible.
    - Use intuitive and recommended names.
    - Use helper method to write graphemes in order to reduce repetition.
    - Update example to use the new names.
- Update styles of displayed borders to showcase various features.
- Document methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants