pub trait Layout {
// Required methods
fn width_for_height(&self, height: usize) -> MinimumNatural<usize>;
fn height_for_width(&self, width: usize) -> MinimumNatural<usize>;
fn prefered_size(&self) -> MinimumNatural<Vec2>;
fn prefered_size_of_container(
&self,
container: Vec2,
) -> MinimumNatural<Vec2>;
}Expand description
A layout trait
It uses height to width management like Gtk
Required Methods§
Sourcefn width_for_height(&self, height: usize) -> MinimumNatural<usize>
fn width_for_height(&self, height: usize) -> MinimumNatural<usize>
Given a height, how much width would this like to have at minimum.
Sourcefn height_for_width(&self, width: usize) -> MinimumNatural<usize>
fn height_for_width(&self, width: usize) -> MinimumNatural<usize>
Given a width, how much height would this like to have at minimum.
Sourcefn prefered_size(&self) -> MinimumNatural<Vec2>
fn prefered_size(&self) -> MinimumNatural<Vec2>
What would this widget like to have in an ideal world.
Sourcefn prefered_size_of_container(&self, container: Vec2) -> MinimumNatural<Vec2>
fn prefered_size_of_container(&self, container: Vec2) -> MinimumNatural<Vec2>
How would this widget choose to allocate itself given the parent’s size