Support simple focusing of items with mouse and Tab key#3
Support simple focusing of items with mouse and Tab key#3abutcher-gh wants to merge 3 commits intoThomasFrans:mainfrom
Conversation
c59f4e3 to
d4e8106
Compare
|
Force pushed to make fmt and clippy happy. |
|
Sorry for the incredibly late reply. I've been on vacation and it took me a while to get back into the right mindset to do development work. I like the idea and I have been thinking the project needed functionality like this. The implementation is good, but I'm wondering one thing: What if the user wants to insert an actual Tab in one of the elements. Maybe I'm overthinking it, but it could be useful to let the developer decide what shortcut is used for forward and backward (backward could always be Shift+). I might be completely overthinking it and maybe the way the original Cursive library does this for LinearLayout is fine. Users just wouldn't be able to insert tabs into views inside a flexbox which shouldn't be that bad I think. What do you think about this? PS: I still need to set up better contributor documentation but I definitely want to find a way to add all contributors to the project somehow (names in a file perhaps). Just wanted to let this know beforehand 🙂 |
This adds basic support for TAB and SHIFT TAB cycling through focusable items in the flexbox, in a similar fashion to navigation in LinearLayout and FixedLayout. It also focuses items that are clicked with a mouse.
I've also updated the
simple_flexboxexample to demonstrate focusing and dynamic changes to the flexbox parameters.I've called this "basic"/"simple" as it only goes as far as top-level item focusing. I.e. it assumes each item is either focusable or not, rather than descending recursively through each to find any focusable controls. I'm not sure whether LinearLayout and FixedLayout do anything different though.