bevy/examples/ui
Nico Burns 363d0f0c7c
Add CSS Grid support to bevy_ui (#8026)
# Objective

An easy way to create 2D grid layouts

## Solution

Enable the `grid` feature in Taffy and add new style types for defining
grids.

## Notes

- ~I'm having a bit of trouble getting `#[derive(Reflect)]` to work
properly. Help with that would be appreciated (EDIT: got it to compile
by ignoring the problematic fields, but this presumably can't be
merged).~ This is now fixed
- ~The alignment types now have a `Normal` variant because I couldn't
get reflect to work with `Option`.~ I've decided to stick with the
flattened variant, as it saves a level of wrapping when authoring
styles. But I've renamed the variants from `Normal` to `Default`.
- ~This currently exposes a simplified API on top of grid. In particular
the following is not currently supported:~
   - ~Negative grid indices~ Now supported.
- ~Custom `end` values for grid placement (you can only use `start` and
`span`)~ Now supported
- ~`minmax()` track sizing functions~ minmax is now support through a
`GridTrack::minmax()` constructor
   - ~`repeat()`~ repeat is now implemented as `RepeatedGridTrack`

- ~Documentation still needs to be improved.~ An initial pass over the
documentation has been completed.

## Screenshot

<img width="846" alt="Screenshot 2023-03-10 at 17 56 21"
src="https://user-images.githubusercontent.com/1007307/224435332-69aa9eac-123d-4856-b75d-5449d3f1d426.png">

---

## Changelog

- Support for CSS Grid layout added to `bevy_ui`

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>
2023-04-17 16:21:38 +00:00
..
button.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
flex_layout.rs Rename text_layout example to flex_layout (#7943) 2023-03-22 08:22:56 +00:00
font_atlas_debug.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
grid.rs Add CSS Grid support to bevy_ui (#8026) 2023-04-17 16:21:38 +00:00
overflow_debug.rs Add overflow_debug example (#8198) 2023-04-05 23:07:41 +00:00
relative_cursor_position.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
text_debug.rs Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
text.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
transparency_ui.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
ui_scaling.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
ui.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
window_fallthrough.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
z_index.rs Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00