-
Notifications
You must be signed in to change notification settings - Fork 310
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
Implement rudimentary support for 'next selectable' for Pile()/Columns() #154
base: master
Are you sure you want to change the base?
Conversation
@wardi Thoughts on this? This sounds like a good feature. |
# set focus back to first selectable | ||
# (but still return key to parent in case we should traverse | ||
# to sibling) | ||
self.focus_first_selectable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing the focus and sending the key back to the parent is a behaviour unlike any other widget. I don't think it makes sense to wrap around inside this container. Maybe let an outer container force wrapping if that's desired (more flexible, allows wrapping through multiple child widgets etc.)
Set the focus of the container to the selectable child widget | ||
that comes first in its hierarchy. | ||
""" | ||
for j in range(0, len(self.contents)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
positions aren't always integers, so it would be better to start from the current focus and get the next child until you find a widget that is selectable. You'll also want to give up after some fixed number because containers may also have an unbounded number of widgets (and might be reading widgets off network or disk when they are iterated over)
I can re-offer the approach taken in khal: pimutils/khal@bd7c5f9 |
Lmk if this is a good general approach!