Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support simple focusing of items with mouse and Tab key #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abutcher-gh
Copy link

@abutcher-gh abutcher-gh commented Jul 2, 2023

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_flexbox example 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.

@abutcher-gh
Copy link
Author

Force pushed to make fmt and clippy happy.

@ThomasFrans
Copy link
Owner

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 🙂

Repository owner deleted a comment from hyassine1 Mar 19, 2024
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.

2 participants