bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Rename `text_layout` example to `flex_layout`

Open doup opened this issue 1 year ago • 7 comments

Objective

  • Rename text_layout example to flex_layout to better reflect the example purpose
  • AlignItems/JustifyContent is not related to text layout, it's about child nodes positioning

Solution

  • Rename the example

doup avatar Mar 07 '23 08:03 doup

I think I originally named it flex_layout even. I changed it because I thought most users probably don't know or care about flex and all the questions and issues I saw were asking about text positioning.

ickshonpe avatar Mar 07 '23 11:03 ickshonpe

I would keep it as flex_layout or maybe nodes_layout… but that will get old as soon as we add CSS grid. I've merged Alice's suggestion, what do you think of?

Demonstrates how the AlignItems and JustifyContent properties can be composed to layout nodes and position text

doup avatar Mar 07 '23 17:03 doup

I would keep it as flex_layout or maybe nodes_layout… but that will get old as soon as we add CSS grid. I've merged Alice's suggestion, what do you think of?

Demonstrates how the AlignItems and JustifyContent properties can be composed to layout nodes and position text

Yep, that looks really good. The renaming definitely makes sense now that we are incorporating grid.

ickshonpe avatar Mar 07 '23 18:03 ickshonpe

Build failed:

bors[bot] avatar Mar 07 '23 20:03 bors[bot]

Once grid is implemented, it might be useful to have an equivalent grid_layout example that gives identical output but uses grid to create the layout.

ickshonpe avatar Mar 08 '23 11:03 ickshonpe

Yup. That was another reason for the rename. ^_^

Also, this example could use a flex-direction toggle, to see how changing the main axis direction affects the layout. But that's for another issue/PR.

doup avatar Mar 08 '23 18:03 doup

Yup. That was another reason for the rename. ^_^

Also, this example could use a flex-direction toggle, to see how changing the main axis direction affects the layout. But that's for another issue/PR.

I considered doing this, but I think it might overcomplicate things. It's probably better to have many smaller examples and cover flex-direction by itself.

ickshonpe avatar Mar 09 '23 10:03 ickshonpe