Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CrossAxisAlignment to Flex to fill the available cross space #1551

Merged
merged 2 commits into from
Jan 31, 2021

Conversation

tirix
Copy link
Contributor

@tirix tirix commented Jan 24, 2021

This is for introducing a new enum value Fill to Flex's CrossAxisAlignment.
Children with the Fill cross axis alignment are laid out to fill the entire available cross space, resulting in such layouts:
image
The same layout using Startlooks like this:
image

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, and I think it's worth trying, although there are some possible gotchas: for instance the user might expect to be able to use SizedBox::expand here in order to use the available space but that will end up in calculating an infinite size in the first layout pass.

I think it's worth getting this in though and seeing if that ends up being a problem in practice, I can see the real benefit here. :)

Thanks!

druid/src/widget/flex.rs Show resolved Hide resolved
@cmyr cmyr merged commit 4c865b9 into linebender:master Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants