Layout

Trait Layout 

Source
pub trait Layout<Props: ?Sized>: DynClone {
    // Required methods
    fn get_props(&self) -> &Props;
    fn stage<'a>(
        &self,
        area: PxRect,
        limits: PxLimits,
        window: &mut WindowState,
    ) -> Box<dyn Staged + 'a>;
}
Expand description

Represents an arbitrary layout node that hasn’t been staged yet. The vast majority of the time, components should simply use the standard Node implementation of this trait, which handles most common layout cases. However, some components, like the text component, have complex layout logic or special cases that Node can’t cover.

Required Methods§

Source

fn get_props(&self) -> &Props

Source

fn stage<'a>( &self, area: PxRect, limits: PxLimits, window: &mut WindowState, ) -> Box<dyn Staged + 'a>

Trait Implementations§

Source§

impl<U: ?Sized, T> Layout<U> for &dyn Layout<T>
where for<'a> &'a T: Into<&'a U>,

Source§

fn get_props(&self) -> &U

Source§

fn stage<'a>( &self, area: PxRect, limits: PxLimits, window: &mut WindowState, ) -> Box<dyn Staged + 'a>

Source§

impl<U: ?Sized, T> Layout<U> for Box<dyn Layout<T>>
where for<'a> &'a T: Into<&'a U>,

Source§

fn get_props(&self) -> &U

Source§

fn stage<'a>( &self, area: PxRect, limits: PxLimits, window: &mut WindowState, ) -> Box<dyn Staged + 'a>

Implementations on Foreign Types§

Source§

impl<U: ?Sized, T> Layout<U> for Box<dyn Layout<T>>
where for<'a> &'a T: Into<&'a U>,

Source§

fn get_props(&self) -> &U

Source§

fn stage<'a>( &self, area: PxRect, limits: PxLimits, window: &mut WindowState, ) -> Box<dyn Staged + 'a>

Implementors§

Source§

impl<T, D: Desc + ?Sized> Layout<T> for feather_ui::layout::Node<T, D>
where for<'a> &'a T: Into<&'a D::Props>,

Source§

impl<T: Padded> Layout<T> for Sized<T>

Source§

impl<T: Padded> Layout<T> for feather_ui::layout::text::Node<T>

Source§

impl<U: ?Sized, T> Layout<U> for &dyn Layout<T>
where for<'a> &'a T: Into<&'a U>,