bevy/crates/bevy_ui/src
Joona Aalto 33c6f45a35
Rename some pointer events and components (#19574)
# Objective

#19366 implemented core button widgets, which included the `Depressed`
state component.

`Depressed` was chosen instead of `Pressed` to avoid conflict with the
`Pointer<Pressed>` event, but it is problematic and awkward in many
ways:

- Using the word "depressed" for such a high-traffic type is not great
due to the obvious connection to "depressed" as in depression.
- "Depressed" is not what I would search for if I was looking for a
component like this, and I'm not aware of any other engine or UI
framework using the term.
- `Depressed` is not a very natural pair to the `Pointer<Pressed>`
event.
- It might be because I'm not a native English speaker, but I have very
rarely heard someone say "a button is depressed". Seeing it, my mind
initially goes from "depression??" to "oh, de-pressed, meaning released"
and definitely not "is pressed", even though that *is* also a valid
meaning for it.

A related problem is that the current `Pointer<Pressed>` and
`Pointer<Released>` event names use a different verb tense than all of
our other observer events such as `Pointer<Click>` or
`Pointer<DragStart>`. By fixing this and renaming `Pressed` (and
`Released`), we can then use `Pressed` instead of `Depressed` for the
state component.

Additionally, the `IsHovered` and `IsDirectlyHovered` components added
in #19366 use an inconsistent naming; the other similar components don't
use an `Is` prefix. It also makes query filters like `Has<IsHovered>`
and `With<IsHovered>` a bit more awkward.

This is partially related to Cart's [picking concept
proposal](https://gist.github.com/cart/756e48a149db2838028be600defbd24a?permalink_comment_id=5598154).

## Solution

- Rename `Pointer<Pressed>` to `Pointer<Press>`
- Rename `Pointer<Released>` to `Pointer<Release>`
- Rename `Depressed` to `Pressed`
- Rename `IsHovered` to `Hovered`
- Rename `IsDirectlyHovered` to `DirectlyHovered`
2025-06-10 21:57:28 +00:00
..
experimental Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
layout Component lifecycle reorganization and documentation (#19543) 2025-06-10 00:59:16 +00:00
render Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
widget Adding PartialEq to some UI and Text types (#19552) 2025-06-09 20:08:17 +00:00
accessibility.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
focus.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
geometry.rs Rename Position to UiPosition in bevy_ui (#19422) 2025-05-29 14:52:44 +00:00
gradients.rs Rename Position to UiPosition in bevy_ui (#19422) 2025-05-29 14:52:44 +00:00
interaction_states.rs Rename some pointer events and components (#19574) 2025-06-10 21:57:28 +00:00
lib.rs Rename some pointer events and components (#19574) 2025-06-10 21:57:28 +00:00
measurement.rs Use CosmicFontSystem in public bevy_text APIs and remove cosmic_text re-export (#16063) 2024-10-23 20:05:28 +00:00
picking_backend.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
stack.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
ui_material.rs Fix Component require() IDE integration (#18165) 2025-03-06 02:44:47 +00:00
ui_node.rs Core button widget (#19366) 2025-06-10 12:50:08 -04:00
ui_transform.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
update.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00