Skip to main content

WindowLayout

Trait WindowLayout 

Source
pub trait WindowLayout {
    // Provided methods
    fn alignment(&self) -> (HorizontalAlignment, VerticalAlignment) { ... }
    fn desired_size_pre_hook(&mut self, available_size: TPoint) { ... }
    fn desired_size(&self, available_size: TPoint) -> TPoint { ... }
    fn margin(&self) -> Thickness { ... }
    fn border(&self) -> BorderStyle { ... }
    fn is_visible(&self) -> bool { ... }
}
Expand description

Properties which define how the window is drawn

Provided Methods§

Source

fn alignment(&self) -> (HorizontalAlignment, VerticalAlignment)

Aligns self within its parent Window

Source

fn desired_size_pre_hook(&mut self, available_size: TPoint)

This is similar to desired_size but will not return anything and can mutably change self This is executed before WindowLayout::desired_size Only implement if actually necessary

Source

fn desired_size(&self, available_size: TPoint) -> TPoint

Parents call this to get the desired size of the child This must not exceed available_size on any axis When the result’s product is equal to 0, this window wont be drawn

Source

fn margin(&self) -> Thickness

Source

fn border(&self) -> BorderStyle

Source

fn is_visible(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§