pub struct LayoutState { /* private fields */ }
Expand description
Holds state used to compute the layout of a tree of widgets
Implementations
sourceimpl LayoutState
impl LayoutState
sourcepub fn add_widget(
&mut self,
widget: WidgetId,
constraints: &Constraints,
children: &[WidgetId]
)
pub fn add_widget(
&mut self,
widget: WidgetId,
constraints: &Constraints,
children: &[WidgetId]
)
Creates a WidgetState entry for a widget.
sourcepub fn compute_constraints(
&mut self,
screen_width: usize,
screen_height: usize,
root_widget: WidgetId
) -> Result<Vec<LaidOutWidget>>
pub fn compute_constraints(
&mut self,
screen_width: usize,
screen_height: usize,
root_widget: WidgetId
) -> Result<Vec<LaidOutWidget>>
Assign the screen dimensions, compute constraints, solve the layout and then apply the size and positioning information to the widgets in the widget tree.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LayoutState
impl !Send for LayoutState
impl !Sync for LayoutState
impl Unpin for LayoutState
impl !UnwindSafe for LayoutState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more