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

Implement rudimentary support for 'next selectable' for Pile()/Columns() #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rianhunter
Copy link
Contributor

Lmk if this is a good general approach!

@and3rson
Copy link
Collaborator

@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()
Copy link
Collaborator

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)):
Copy link
Collaborator

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)

@geier
Copy link
Contributor

geier commented Jan 12, 2018

I can re-offer the approach taken in khal: pimutils/khal@bd7c5f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request/implementation in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants