Skip to main content

LayoutableImpl

Trait LayoutableImpl 

Source
pub trait LayoutableImpl: VisualImpl + Upcast<Layoutable> {
    // Provided methods
    fn apply_template(this: &Self) { ... }
    fn measure_core(this: &Self, available_size: Size) -> Size { ... }
    fn measure_override(this: &Self, available_size: Size) -> Size { ... }
    fn arrange_core(this: &Self, final_rect: Rect) { ... }
    fn arrange_override(this: &Self, final_size: Size) -> Size { ... }
    fn on_measure_invalidated(this: &Self) { ... }
}
Expand description

The overridable members introduced by the class.

Provided Methods§

Source

fn apply_template(this: &Self)

Creates the visual children of the control, if necessary.

Source

fn measure_core(this: &Self, available_size: Size) -> Size

The default implementation of the control’s measure pass.

This calculates the desired size taking into account the control’s margin and min/max/explicit size, and calls measure_override for the content. Usually measure_override is what you want to override.

Source

fn measure_override(this: &Self, available_size: Size) -> Size

Measures the control and its child elements as part of a layout pass. Returns the size the control would like to be.

Source

fn arrange_core(this: &Self, final_rect: Rect)

The default implementation of the control’s arrange pass.

This calculates the final bounds taking into account the control’s margin, alignment and size constraints, and calls arrange_override for the content. Usually arrange_override is what you want to override.

Source

fn arrange_override(this: &Self, final_size: Size) -> Size

Positions child elements as part of a layout pass. Returns the size used.

Source

fn on_measure_invalidated(this: &Self)

Called by invalidate_measure.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§