bevy/examples/ui
Talin 4ff595a4bc
New simplified "click to focus" logic for core widgets. (#19736)
Click to focus is now a global observer.

# Objective

Previously, the "click to focus" behavior was implemented in each
individual headless widget, producing redundant logic.

## Solution

The new scheme is to have a global observer which looks for pointer down
events and triggers an `AcquireFocus` event on the target. This event
bubbles until it finds an entity with `TabIndex`, and then focuses it.

## Testing

Tested the changes using the various examples that have focusable
widgets. (This will become easier to test when I add focus ring support
to the examples, but that's for another day. For now you just have to
know which keys to press.)

## Migration

This change is backwards-compatible. People who want the new behavior
will need to install the new plugin.
2025-06-21 18:05:26 +00:00
..
borders.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
box_shadow.rs Minor refactoring of box_shadow example (#19404) 2025-05-27 23:44:32 +00:00
button.rs Color interpolation in OKLab, OKLCH spaces for UI gradients (#19330) 2025-06-21 15:06:35 +00:00
core_widgets_observers.rs New simplified "click to focus" logic for core widgets. (#19736) 2025-06-21 18:05:26 +00:00
core_widgets.rs New simplified "click to focus" logic for core widgets. (#19736) 2025-06-21 18:05:26 +00:00
directional_navigation.rs Provide access to the original target of entity-events in observers (#19663) 2025-06-15 20:53:25 +00:00
display_and_visibility.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
flex_layout.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
font_atlas_debug.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
ghost_nodes.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
gradients.rs Color interpolation in OKLab, OKLCH spaces for UI gradients (#19330) 2025-06-21 15:06:35 +00:00
grid.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
overflow_clip_margin.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
overflow_debug.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
overflow.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
relative_cursor_position.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
render_ui_to_texture.rs Rename TargetCamera to UiTargetCamera (#17403) 2025-01-19 19:56:57 +00:00
scroll.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
size_constraints.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
stacked_gradients.rs Color interpolation in OKLab, OKLCH spaces for UI gradients (#19330) 2025-06-21 15:06:35 +00:00
tab_navigation.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
text_background_colors.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text_debug.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text_wrap_debug.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
text.rs Rename JustifyText to Justify (#19522) 2025-06-09 19:59:48 +00:00
transparency_ui.rs
ui_material.rs
ui_scaling.rs Rename Timer::finished and Timer::paused to is_finished and is_paused (#19386) 2025-05-27 22:24:18 +00:00
ui_texture_atlas_slice.rs
ui_texture_atlas.rs
ui_texture_slice_flip_and_tile.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
ui_texture_slice.rs BorderRect maintenance (#16727) 2024-12-12 04:33:44 +00:00
ui_transform.rs Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
viewport_debug.rs separate border colors (#18682) 2025-05-26 16:57:13 +00:00
viewport_node.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
window_fallthrough.rs Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
z_index.rs