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

Rename Interaction::Click #8989

Closed
Shatur opened this issue Jun 28, 2023 · 4 comments · Fixed by #9027
Closed

Rename Interaction::Click #8989

Shatur opened this issue Jun 28, 2023 · 4 comments · Fixed by #9027
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@Shatur
Copy link
Contributor

Shatur commented Jun 28, 2023

What problem does this solve or what need does it fill?

When I saw this variant, I thought that it works like in usual in UI - if I press and release the RMB over the button, then it is considered as "clicked". Also all examples check Interaction::Click for button pressing.
But it's not how it works! Interaction::Click just represents the pressed state of a button.

What solution would you like?

Rename Interaction::Click into Interaction::Pressed. This will by much clear. No functional changes.

Additional context

I think Interaction represents the state of the button and it's handy for changing the appearance.
But to check for clicking, I would add additional mechanism and I think it should be an event, not a state (an RMB press and then release over the button).

@Shatur Shatur added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jun 28, 2023
@alice-i-cecile alice-i-cecile added A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jun 28, 2023
@mockersf mockersf added the A-UI Graphical user interfaces, styles, layouts, and widgets label Jun 28, 2023
@AnbyKatz
Copy link
Contributor

AnbyKatz commented Jul 2, 2023

I don't mind giving this one a go if no one else is doing it :)

@Shatur
Copy link
Contributor Author

Shatur commented Jul 2, 2023

@AnthonyKalaitzis do it, maybe we could get it to 0.11 since it's a simple rename.

@AnbyKatz
Copy link
Contributor

AnbyKatz commented Jul 2, 2023

@Shatur When you say Interaction::Click, do you mean Interaction::Clicked? The Interaction enum appears to be in bevy_ui/src/focus.rs and I don't see any others so just double checking that's what you mean.

@Shatur
Copy link
Contributor Author

Shatur commented Jul 2, 2023

@AnthonyKalaitzis Yes :)

github-merge-queue bot pushed a commit that referenced this issue Jul 5, 2023
# Objective

- Fixes #8989

## Solution

- Renamed Interaction::Clicked -> Interaction::Pressed
- Minor changes to comments to keep clarity of terms

## Migration Guide

- Rename all instances of Interaction::Clicked -> Interaction::Pressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants