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

ActionGroup in spinner mode doesn't close on selection. #1906

Closed
philwrenn opened this issue Feb 20, 2014 · 7 comments · Fixed by #4441
Closed

ActionGroup in spinner mode doesn't close on selection. #1906

philwrenn opened this issue Feb 20, 2014 · 7 comments · Fixed by #4441
Labels
easy Should be easy to fix

Comments

@philwrenn
Copy link

If I run run the actionbar.py module directly, executing the "if main" block. The actionbar example loads without error. On my system both of the ActionGroups are displayed in spinner mode due to the available space. If I click an ActionGroup spinner it opens, but selecting an item in the group does not close the dropdown. The only way I have found to close the dropdown it to click elsewhere on the screen.

https://gist.github.com/philwrenn/9121379

There were no errors. I just added the log per the posting instructions.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@AphonicChaos
Copy link
Contributor

The issues is that the button's click isn't being mapped to anything. by adding on_press events to these, it's easy enough to get expected behavior. The question then becomes whether or not events should be added automatically when a widget is added to an ActionGroup.

Is there ever a case where you would want the popup to remain even after clicking a button (I'm thinking of "pinned" menubars here)? If not, sane defaults might make sense here.

@philwrenn
Copy link
Author

Adding on_press events does not seem to change the behavior of the dropdown.

https://gist.github.com/philwrenn/9130426

@AphonicChaos
Copy link
Contributor

I wasn't specific enough, and even used the wrong event. Firstly, it needs to specifically be connected to the ActionGroup's dropdown's select event. Secondly, it should be the on_release button:

https://gist.github.com/aspidites/9130590

I might have missed something, but it seems there should be a more direct way to get to the underlying dropdown. or perhaps default behavior for a list of widgets should be available (eg. for items that are clickable, the released property should be bound to).

@philwrenn
Copy link
Author

That approach works fine for ActionGroups their mode set to 'spinner'. Things get a little more interesting when accommodating the overflow behavior of buttons directly in an ActionView.

https://gist.github.com/philwrenn/9135418

Also, since ActionItems in an ActionGroup without an explicit mode may render either way, depending on space, I was thinking you would always want to call select on the ActionGroup's dropdown. The problem is that causes an error if the ActionGroup renders in normal mode.

https://gist.github.com/philwrenn/9135473

@AphonicChaos
Copy link
Contributor

While they are both related to each other, neither of them is related to this issue. Please open a separate issue for those. In the meantime I'm looking at what causes the behavior at the moment.

@AphonicChaos
Copy link
Contributor

I think what's essentially going on is that if an ActionOverflow doesn't have a parent, the dropdown errors out because it can't properly call add_widget.

@DanielKoohmarey
Copy link

Any updates on a successful approach to auto close the dropdown on selection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Should be easy to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants