FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    LayoutHelper

    struct · ferroui-base · v0.5.0

    struct LayoutHelper
    

    Provides helper methods needed for layout.

    View source

    Members

    LAYOUT_EPSILON

    const LAYOUT_EPSILON: f64
    

    Epsilon value used for certain layout calculations. Based on the value in WPF LayoutDoubleUtil.

    Source

    apply_layout_constraints

    fn apply_layout_constraints(control: &Layoutable, constraints: Size) -> Size
    

    Calculates a control's size based on its width, height, min-width, min-height, max-width and max-height.

    Source

    measure_hold_with_border

    fn measure_hold_with_border(control: Option<&Layoutable>, padding: Thickness, border_thickness: Thickness) -> Option<crate::layout::MeasureHold>
    

    Measures a child with padding and a border, returning the desired size including them. The measure hold of an element that measures control as Self::measure_child_with_border does: the child's hold moved by the padding and the border (desktop-performance.md section 9.15); without a child, every size.

    Source

    measure_child_with_border

    fn measure_child_with_border(control: Option<&Layoutable>, available_size: Size, padding: Thickness, border_thickness: Thickness) -> Size
    

    Source

    measure_child

    fn measure_child(control: Option<&Layoutable>, available_size: Size, padding: Thickness) -> Size
    

    Measures a child with padding, returning the desired size including the padding.

    Source

    arrange_child_with_border

    fn arrange_child_with_border(child: Option<&Layoutable>, available_size: Size, padding: Thickness, border_thickness: Thickness) -> Size
    

    Arranges a child inside padding and a border.

    Source

    arrange_child

    fn arrange_child(child: Option<&Layoutable>, available_size: Size, padding: Thickness) -> Size
    

    Arranges a child inside padding.

    Source

    invalidate_self_and_children_measure

    fn invalidate_self_and_children_measure(control: &Layoutable)
    

    Invalidates measure for the control and all of its visual descendants.

    Source

    get_layout_scale

    fn get_layout_scale(control: &Layoutable) -> f64
    

    Obtains the layout scale of the given control, based on its layout root.

    Source

    round_layout_size_up

    fn round_layout_size_up(size: Size, dpi_scale: f64) -> Size
    

    Rounds a size to an integer number of device pixels, rounding up.

    Source

    round_layout_thickness

    fn round_layout_thickness(thickness: Thickness, dpi_scale: f64) -> Thickness
    

    Rounds a thickness to integer numbers of device pixels.

    Source

    round_layout_point

    fn round_layout_point(point: Point, dpi_scale: f64) -> Point
    

    Rounds a point to integer device pixels.

    Source

    round_layout_value

    fn round_layout_value(value: f64, dpi_scale: f64) -> f64
    

    Calculates the value to be used for layout rounding at high DPI by rounding the value up or down to the nearest pixel.

    Source

    round_layout_value_up

    fn round_layout_value_up(value: f64, dpi_scale: f64) -> f64
    

    Calculates the value to be used for layout rounding at high DPI by rounding the value up to the nearest pixel.

    Source

    validate_scaling

    fn validate_scaling(scaling: f64) -> f64
    

    Validates a render/layout scaling value, normalizing values close to one to exactly one. Panics on invalid values.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.