Allow flex items to float to the end of the flex axis

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-03-30 16:38:00 +02:00
parent 621e67bca7
commit 0453dd1101
16 changed files with 138 additions and 104 deletions

View file

@ -139,11 +139,18 @@ pub trait Element {
Expanded::new(self.boxed())
}
fn flexible(self, flex: f32, expanded: bool) -> Flexible
fn flex(self, flex: f32, expanded: bool) -> FlexItem
where
Self: 'static + Sized,
{
Flexible::new(flex, expanded, self.boxed())
FlexItem::new(self.boxed()).flex(flex, expanded)
}
fn flex_float(self) -> FlexItem
where
Self: 'static + Sized,
{
FlexItem::new(self.boxed()).float()
}
}