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

Improve MenuButton and OptionButton #66748

Merged

Conversation

EricEzaM
Copy link
Contributor

@EricEzaM EricEzaM commented Oct 2, 2022

Closes #66308
Closes #66403 - apologies, I did mark this one as a good first issue but I thought it would be easiest to get two birds with one stone here.

@EricEzaM EricEzaM requested review from a team as code owners October 2, 2022 06:48
@EricEzaM EricEzaM added this to the 4.0 milestone Oct 2, 2022
if (popup->activate_item_by_event(p_event, false)) {
accept_event();
}
if (p_event->is_pressed() && !p_event->is_echo() && !is_disabled() && is_visible_in_tree() && popup->activate_item_by_event(p_event, false)) {
Copy link
Contributor Author

@EricEzaM EricEzaM Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was able to get rid of all the casts here since shortcut input in the viewport already narrows this down for us. Related:
#62899

@EricEzaM EricEzaM force-pushed the 66308-66403-menubutton-improvements branch from cc208bf to 42696fb Compare October 2, 2022 23:56
scene/gui/menu_button.cpp Outdated Show resolved Hide resolved
@EricEzaM EricEzaM force-pushed the 66308-66403-menubutton-improvements branch from 42696fb to 272c297 Compare October 3, 2022 10:07
* MenuButton + OptionButton: Add method `show_popup()` which performs required popup setup before showing (prefer use of this over `get_popup()->popup()`, otherwise GH godotengine#66308 occurs)
* MenuButton: Ensure that the menu can be opened with a shortcut, if one is set for the button. (GH godotengine#66403). Ensure that popupmenu item shortcuts are checked first before the MenuButton shortcut.
@akien-mga akien-mga merged commit 306cbeb into godotengine:master Oct 3, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants