Rename some pointer events and components #19574
Merged
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.
Objective
#19366 implemented core button widgets, which included the
Depressed
state component.Depressed
was chosen instead ofPressed
to avoid conflict with thePointer<Pressed>
event, but it is problematic and awkward in many ways:Depressed
is not a very natural pair to thePointer<Pressed>
event.A related problem is that the current
Pointer<Pressed>
andPointer<Released>
event names use a different verb tense than all of our other observer events such asPointer<Click>
orPointer<DragStart>
. By fixing this and renamingPressed
(andReleased
), we can then usePressed
instead ofDepressed
for the state component.Additionally, the
IsHovered
andIsDirectlyHovered
components added in #19366 use an inconsistent naming; the other similar components don't use anIs
prefix. It also makes query filters likeHas<IsHovered>
andWith<IsHovered>
a bit more awkward.This is partially related to Cart's picking concept proposal.
Solution
Pointer<Pressed>
toPointer<Press>
Pointer<Released>
toPointer<Release>
Depressed
toPressed
IsHovered
toHovered
IsDirectlyHovered
toDirectlyHovered