-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add event for clicks #10141
Closed
Closed
Add event for clicks #10141
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
d7c1113
Add API to support publishing click events for UI nodes
ae0e726
Refactor game_menu example to use Click events
b63703f
Add LastInteraction into prelude
615db07
Refactor for LastInteraction In ButtonBundle
8db5137
Fix PreUpdate systems call order
bdd29aa
Revert to old name for menu_action
396d95f
Extend state example to use Click events
7169033
Remove EventReader<Click> for simpler add_systems call
68d8f7a
Fix name error for function calls
7805a07
Combine Update add systems calls
b62bab1
For reals combine all add_systems calls run on Update
47b3226
Move add order for consistency
bb0a31d
Refactor display & visibility example for click events
020baca
Merge branch 'main' into add-event-for-clicks
9134ca3
Fix game menu example for changed event reader iterator
f07e153
Fix event reader iterator call on missed example
0729791
Minor grammar and syntax changes
898d202
Refactor size constraints example for click event
5174150
Remove ButtonActivatedEvent, replace with Click
bf4655c
Fix failing doc test
8dd6901
Change scope of event writer in an attempt to fix doc test
6842ccf
Simplify send of click event
15abb9c
Remove LastInteraction struct
94c39d9
Remove unused import
589d9d0
Simplify tuple unpacking for click events in examples
86961a3
Change tuple packing back
95d34b5
Move the click send to incorporate hover
ad556b2
Amend click event comment
5f12182
Change Click -> Clicked
198542a
Refactor iteration to old method
9f92e48
Fix click typo
4c9b271
Remove old comment
84f88a4
Merge remote-tracking branch 'origin/main' into add-event-for-clicks
Shatur 8bb6d3b
Update crates/bevy_ui/src/focus.rs
Shatur 1b5a278
Register click only if the button was pressed before
Shatur c53a16f
Add import
Shatur 48ad80c
Fix doc link
Shatur 981890a
Update size constraints example
Shatur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure "clicked" conveys the right meaning, as the name doesn't imply it's on release. The Web API's click event is only emitted on release just like you implemented it here, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think clicks in any UI always works this way. But won't hurt to mention in the docs, of course!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, "click" is the right terminology here. We have "pressed" as a one-phase event, "just pressed" as a two-phase event, and "clicked" as a three-phase event.