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

Adds a pressed signal to ButtonGroup #48500

Merged
merged 1 commit into from
May 6, 2021

Conversation

groud
Copy link
Member

@groud groud commented May 6, 2021

A simple QoL improvement we discussed with reduz some time ago. This adds a "pressed" signal to the ButtonGroup resource.

Often a ButtonGroup is used for mutually exclusive tools (in a toolbar), so you usually need a single callback where you check with ButtonGroup.get_pressed_button() which button is pressed.

However, until now, the callback needed to be registered to every single button in the group, while it's more convenient to register the callback once to the ButtonGroup instead. This is what this PR implements.

It could likely be backported.

Edit: closes #22839

@groud groud added this to the 4.0 milestone May 6, 2021
@groud groud requested review from a team as code owners May 6, 2021 10:27
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 6, 2021
@akien-mga akien-mga merged commit 89e6f6c into godotengine:master May 6, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way to detect button state changes within a ButtonGroup
3 participants