From f754cecb491e983fc0a8865ff6cb532490abaea2 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 7 Nov 2024 13:52:58 -0800 Subject: [PATCH] UiImage -> ImageNode, UiImageSize -> ImageNodeSize (#16271) # Objective Align `UiImage` with the new `XNode` naming convention. ## Solution - Rename `UiImage` to `ImageNode` - Rename `UiImageSize` to `ImageNodeSize` --- ## Migration Guide Before: ```rust commands.spawn(UiImage::new(image)); ```` After: ```rust commands.spawn(ImageNode::new(image)); ``` --- crates/bevy_ui/src/accessibility.rs | 7 +++-- crates/bevy_ui/src/lib.rs | 14 +++++----- crates/bevy_ui/src/node_bundles.rs | 14 +++++----- crates/bevy_ui/src/render/mod.rs | 10 +++---- crates/bevy_ui/src/render/render_pass.rs | 4 +-- .../src/render/ui_texture_slice_pipeline.rs | 4 +-- crates/bevy_ui/src/widget/image.rs | 28 +++++++++---------- examples/3d/auto_exposure.rs | 4 +-- examples/games/game_menu.rs | 8 +++--- examples/stress_tests/many_buttons.rs | 2 +- examples/testbed/ui.rs | 16 +++++------ examples/ui/font_atlas_debug.rs | 2 +- examples/ui/overflow.rs | 2 +- examples/ui/overflow_clip_margin.rs | 2 +- examples/ui/overflow_debug.rs | 2 +- examples/ui/ui_scaling.rs | 2 +- examples/ui/ui_texture_atlas.rs | 14 +++++++--- examples/ui/ui_texture_atlas_slice.rs | 4 +-- examples/ui/ui_texture_slice.rs | 9 ++++-- examples/ui/ui_texture_slice_flip_and_tile.rs | 2 +- 20 files changed, 81 insertions(+), 69 deletions(-) diff --git a/crates/bevy_ui/src/accessibility.rs b/crates/bevy_ui/src/accessibility.rs index f4d331b9ca..51fcc5be81 100644 --- a/crates/bevy_ui/src/accessibility.rs +++ b/crates/bevy_ui/src/accessibility.rs @@ -1,7 +1,7 @@ use crate::{ experimental::UiChildren, prelude::{Button, Label}, - widget::{TextUiReader, UiImage}, + widget::{ImageNode, TextUiReader}, ComputedNode, }; use bevy_a11y::{ @@ -92,7 +92,10 @@ fn button_changed( fn image_changed( mut commands: Commands, - mut query: Query<(Entity, Option<&mut AccessibilityNode>), (Changed, Without