pub trait Layoutable {
// Required methods
fn loc(&self) -> Point2D<f64, LogicalSpace>;
fn set_loc(&mut self, p: Point2D<f64, LogicalSpace>);
fn size(&self) -> Size2D<f64, LogicalSpace>;
fn set_size(&mut self, s: Size2D<f64, LogicalSpace>);
// Provided methods
fn rect(&self) -> Rect<f64, LogicalSpace> { ... }
fn set_rect(&mut self, r: Rect<f64, LogicalSpace>) { ... }
fn preferred_size(&self) -> Size2D<f64, LogicalSpace> { ... }
fn min_size(&self) -> Size2D<f64, LogicalSpace> { ... }
}Available on crate feature
winio only.Expand description
Trait for a layoutable widget.
To create a responsive layout, always set location and size together.
Required Methods§
Sourcefn loc(&self) -> Point2D<f64, LogicalSpace>
fn loc(&self) -> Point2D<f64, LogicalSpace>
The left top location.
Sourcefn set_loc(&mut self, p: Point2D<f64, LogicalSpace>)
fn set_loc(&mut self, p: Point2D<f64, LogicalSpace>)
Move the location.
Sourcefn size(&self) -> Size2D<f64, LogicalSpace>
fn size(&self) -> Size2D<f64, LogicalSpace>
The size.
Sourcefn set_size(&mut self, s: Size2D<f64, LogicalSpace>)
fn set_size(&mut self, s: Size2D<f64, LogicalSpace>)
Resize.
Provided Methods§
Sourcefn rect(&self) -> Rect<f64, LogicalSpace>
fn rect(&self) -> Rect<f64, LogicalSpace>
The bounding rectangle.
Sourcefn set_rect(&mut self, r: Rect<f64, LogicalSpace>)
fn set_rect(&mut self, r: Rect<f64, LogicalSpace>)
Set the location and size.
Sourcefn preferred_size(&self) -> Size2D<f64, LogicalSpace>
fn preferred_size(&self) -> Size2D<f64, LogicalSpace>
The preferred size.
Sourcefn min_size(&self) -> Size2D<f64, LogicalSpace>
fn min_size(&self) -> Size2D<f64, LogicalSpace>
Min acceptable size.