Repository navigation
Add BorderLabels to Border widget - #214
Conversation
rockorager
left a comment
There was a problem hiding this comment.
This is a good feature to add. Approach is good but you just need to make sure you are working on graphemes vs bytes.
- used Grapheme Iterator instead of old range based loop. - used `ctx.stringWidth()` instead of `text.len`. - added empty label guard.
|
@rockorager I have made the changes requested. |
rockorager
left a comment
There was a problem hiding this comment.
One remaining issue on the loop.
|
@rockorager Done. (I think I need to get a good grasp on grapheme iterator) |
|
@rockorager I have made requested changes. Is there anything needed to be done? |
|
One change and one nit left! I was going to ignore the nit but since there is another change to make I added it. Thanks! |
…ition. - Changed from `.width=1` to `.width=width`
|
@rockorager I have made the requested changes! |
|
@rockorager I think I need to intcast it |
Yep! |
|
@rockorager Done! I ran tests in my local and verified! |
|
Can you run zig fmt to fix the check-fmt test? |
|
@rockorager Literally just 2 spaces lmao. Anyways, fixed it! |
* 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
Added BorderLabels to Border Widget to show text inline along the borders. Currently, it has the following alignment options,
Here is a screenshot,

Example code snippet,