bevy/crates/bevy_ui/src
Peter Hayman b8416b3043
Add some missing reflect attributes (#14259)
# Objective

- Some types are missing reflection attributes, which means we can't use
them in scene serialization etc.
- Effected types
   - `BorderRadius`
   - `AnimationTransitions`
   - `OnAdd`
   - `OnInsert`
   - `OnRemove`
- My use-case for `OnAdd` etc to derive reflect is 'Serializable
Observer Components'. Add the component, save the scene, then the
observer is re-added on scene load.

```rust
#[derive(Reflect)]
struct MySerializeableObserver<T: Event>(#[reflect(ignore)]PhantomData<T>);

impl<T: Event> Component for MySerializeableObserver<T> {
  const STORAGE_TYPE: StorageType  = StorageType::Table;
    fn register_component_hooks(hooks: &mut ComponentHooks) {
      hooks.on_add(|mut world, entity, _| {
        world
          .commands()
          .entity(entity)
          .observe(|_trigger: Trigger<T>| {
            println!("it triggered etc.");
          });
    });
  }
}
```

## Solution

- Add the missing traits

---
2024-07-22 18:24:10 +00:00
..
layout add entity to error message (#14163) 2024-07-08 01:01:47 +00:00
render Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
widget Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
accessibility.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
focus.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
geometry.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
lib.rs Clean up UiSystem system sets (#14228) 2024-07-15 15:27:38 +00:00
measurement.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
node_bundles.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
stack.rs Merge BuildWorldChildren and BuildChildren traits. (#14052) 2024-07-01 14:29:39 +00:00
texture_slice.rs Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00
ui_material.rs Fix incorrect link in UiMaterial documentation (#12361) 2024-03-07 22:09:57 +00:00
ui_node.rs Add some missing reflect attributes (#14259) 2024-07-22 18:24:10 +00:00
update.rs fix: use try_insert instead of insert in bevy_ui to prevent panics when despawning ui nodes (#13000) 2024-04-19 18:12:08 +00:00