Introduce Expanded element

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-01-06 17:35:45 -08:00
parent 1f762e482d
commit 2b36ab0de7
2 changed files with 99 additions and 0 deletions

View file

@ -4,6 +4,7 @@ mod constrained_box;
mod container;
mod empty;
mod event_handler;
mod expanded;
mod flex;
mod hook;
mod image;
@ -16,6 +17,7 @@ mod svg;
mod text;
mod uniform_list;
use self::expanded::Expanded;
pub use self::{
align::*, canvas::*, constrained_box::*, container::*, empty::*, event_handler::*, flex::*,
hook::*, image::*, label::*, list::*, mouse_event_handler::*, overlay::*, stack::*, svg::*,
@ -130,6 +132,13 @@ pub trait Element {
Container::new(self.boxed())
}
fn expanded(self) -> Expanded
where
Self: 'static + Sized,
{
Expanded::new(self.boxed())
}
fn flexible(self, flex: f32, expanded: bool) -> Flexible
where
Self: 'static + Sized,