bevy/crates/bevy_ui/src
ickshonpe fe37ba5360
Change the default for the measure_func field of ContentSize to None. (#9346)
# Objective

The default for `ContentSize` should have the `measure_func` field set
to `None`, instead of a fixed size of zero. This means that until a
measure func is set the size of the UI node will be determined by its
`Style` constraints. This is preferable as it allows users to specify
the space the Node should take up in the layout while waiting for
content to load.

## Solution

Derive `Default` for `ContentSize`.

The PR also adds a `fixed_size` helper function to make it a bit easier
to access the old behaviour.

## Changelog
* Derived `Default` for `ContentSize`
* Added a `fixed_size` helper function to `ContentSize` that creates a
new `ContentSize` with a `MeasureFunc` that always returns the same
value, regardless of layout constraints.

## Migration Guide
The default for `ContentSize` now sets its `measure_func` to `None`,
instead of a fixed size measure that returns `Vec2::ZERO`.
The helper function `fixed_size` can be called with
`ContentSize::fixed_size(Vec2::ZERO)` to get the previous behaviour.
2023-08-07 23:06:40 +00:00
..
layout Growing UI nodes Fix (#8931) 2023-07-09 07:33:22 +00:00
render Remove the With<Parent> query filter from bevy_ui::render::extract_uinode_borders (#9285) 2023-07-31 20:33:17 +00:00
widget Improved text widget doc comments (#9344) 2023-08-05 13:53:23 +00:00
accessibility.rs Move bevy_ui accessibility systems to PostUpdate. (#8653) 2023-05-23 23:50:48 +00:00
camera_config.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
focus.rs Divide by UiScale when converting UI coordinates from physical to logical (#8720) 2023-07-06 20:27:54 +00:00
geometry.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
lib.rs Allow tuples and single plugins in add_plugins, deprecate add_plugin (#8097) 2023-06-21 20:51:03 +00:00
measurement.rs Change the default for the measure_func field of ContentSize to None. (#9346) 2023-08-07 23:06:40 +00:00
node_bundles.rs Fix missing bevy_text feature cfg attribute (#8670) 2023-06-29 00:33:35 +00:00
stack.rs Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
ui_node.rs bevy_ui: fix doc formatting for some Style fields (#9295) 2023-07-29 22:22:24 +00:00
update.rs Split UI Overflow by axis (#8095) 2023-04-17 22:23:52 +00:00