gyscos / cursive

A Text User Interface library for the Rust programming language
MIT License
4.26k stars 243 forks source link

[Fixes #763] Introduced labelled checkboxes #765

Open michalfita opened 11 months ago

michalfita commented 11 months ago

Purpose

To address #763 and improve overall UX of using Checkbox in the application.

Scope

To do

Notes

Commits bring changes incrementally, so I suggest reviewing them one by one and consider rejections based on changes in them as maybe not all PR would need to be rejected at once.

For now I do draft for first impression where I'm heading. I'm trying to not break original API, however, some alignment with RadioButton in future would do good.

gyscos commented 4 months ago

Thanks for the work!

I merged main into this branch (solving minor conflicts that arose when views became Send), and it should now be closer to ready.

One remark: the example now shows 2 ways to make groups of checkboxes: the "manual way" (for toppings) and the "managed way" (for extras). To keep the example simple, I think we can get rid of the manual way and only show how to use the multichoice group.

Instead, we could include a couple of "non-grouped" checkboxes, to show that it's still an option for single options. Or not, since that's already covered in the "list_view" example. In that case, I would rename the checkbox example to checkbox_group or multichoice_group.

michalfita commented 4 months ago

@gyscos Oh man, it's been a while since I've been on this... Finding time to go back to this may be close to impossible in a next few weeks.