FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Layoutable

    struct · ferroui-base · v0.5.0

    struct Layoutable
    

    Implements layout-related functionality for a control.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<Layoutable>
    

    Returns a strong reference to this object.

    Source

    apply_template

    fn apply_template(self: &Self)
    

    Creates the visual children of the control, if necessary.

    Source

    measure_core

    fn measure_core(self: &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

    measure_override

    fn measure_override(self: &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

    measure_hold_override

    fn measure_hold_override(self: &Self, constraint: Size) -> Option<crate::layout::MeasureHold>
    

    The range of constraints, around the one measure_override was just given, over which it returns the same size and leaves the descendants as they are, or None (the default) when only that constraint is known to. An addition (desktop-performance.md section 9.15): an element is not measured again at an available size inside the hold.

    Source

    arrange_core

    fn arrange_core(self: &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

    arrange_override

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

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

    Source

    on_measure_invalidated

    fn on_measure_invalidated(self: &Self)
    

    Called by invalidate_measure.

    Source

    desired_size_property

    fn desired_size_property() -> &'static DirectProperty<Layoutable, Size>
    

    Defines the DesiredSize property.

    Source

    width_property

    fn width_property() -> &'static StyledProperty<f64>
    

    Defines the Width property.

    Source

    height_property

    fn height_property() -> &'static StyledProperty<f64>
    

    Defines the Height property.

    Source

    min_width_property

    fn min_width_property() -> &'static StyledProperty<f64>
    

    Defines the MinWidth property.

    Source

    max_width_property

    fn max_width_property() -> &'static StyledProperty<f64>
    

    Defines the MaxWidth property.

    Source

    min_height_property

    fn min_height_property() -> &'static StyledProperty<f64>
    

    Defines the MinHeight property.

    Source

    max_height_property

    fn max_height_property() -> &'static StyledProperty<f64>
    

    Defines the MaxHeight property.

    Source

    margin_property

    fn margin_property() -> &'static StyledProperty<Thickness>
    

    Defines the Margin property.

    Source

    horizontal_alignment_property

    fn horizontal_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
    

    Defines the HorizontalAlignment property.

    Source

    vertical_alignment_property

    fn vertical_alignment_property() -> &'static StyledProperty<VerticalAlignment>
    

    Defines the VerticalAlignment property.

    Source

    use_layout_rounding_property

    fn use_layout_rounding_property() -> &'static StyledProperty<bool>
    

    Defines the UseLayoutRounding property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see crate::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    effective_viewport_changed

    fn effective_viewport_changed(self: &Self, handler: impl Fn(&EffectiveViewportChangedEventArgs) -> () + 'static) -> Subscription
    

    Occurs when the element's effective viewport changes.

    Source

    layout_updated

    fn layout_updated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Occurs when a layout pass completes for the control.

    Source

    update_layout

    fn update_layout(self: &Self)
    

    Executes a layout pass.

    You should not usually need to call this method explicitly: the layout manager schedules layout passes itself.

    Source

    width

    fn width(self: &Self) -> f64
    

    The width of the element.

    Source

    set_width

    fn set_width(self: &Self, value: f64)
    

    Source

    height

    fn height(self: &Self) -> f64
    

    The height of the element.

    Source

    set_height

    fn set_height(self: &Self, value: f64)
    

    Source

    min_width

    fn min_width(self: &Self) -> f64
    

    The minimum width of the element.

    Source

    set_min_width

    fn set_min_width(self: &Self, value: f64)
    

    Source

    max_width

    fn max_width(self: &Self) -> f64
    

    The maximum width of the element.

    Source

    set_max_width

    fn set_max_width(self: &Self, value: f64)
    

    Source

    min_height

    fn min_height(self: &Self) -> f64
    

    The minimum height of the element.

    Source

    set_min_height

    fn set_min_height(self: &Self, value: f64)
    

    Source

    max_height

    fn max_height(self: &Self) -> f64
    

    The maximum height of the element.

    Source

    set_max_height

    fn set_max_height(self: &Self, value: f64)
    

    Source

    margin

    fn margin(self: &Self) -> Thickness
    

    The margin around the element.

    Source

    set_margin

    fn set_margin(self: &Self, value: Thickness)
    

    Source

    horizontal_alignment

    fn horizontal_alignment(self: &Self) -> HorizontalAlignment
    

    The element's preferred horizontal alignment in its parent.

    Source

    set_horizontal_alignment

    fn set_horizontal_alignment(self: &Self, value: HorizontalAlignment)
    

    Source

    vertical_alignment

    fn vertical_alignment(self: &Self) -> VerticalAlignment
    

    The element's preferred vertical alignment in its parent.

    Source

    set_vertical_alignment

    fn set_vertical_alignment(self: &Self, value: VerticalAlignment)
    

    Source

    desired_size

    fn desired_size(self: &Self) -> Size
    

    The size that this element computed during the measure pass of the layout process.

    Source

    is_measure_valid

    fn is_measure_valid(self: &Self) -> bool
    

    Whether the control's layout measure is valid.

    Source

    is_arrange_valid

    fn is_arrange_valid(self: &Self) -> bool
    

    Whether the control's layout arrange is valid.

    Source

    use_layout_rounding

    fn use_layout_rounding(self: &Self) -> bool
    

    Whether the control's layout should be snapped to pixel boundaries.

    Source

    set_use_layout_rounding

    fn set_use_layout_rounding(self: &Self, value: bool)
    

    Source

    previous_measure

    fn previous_measure(self: &Self) -> Option<Size>
    

    The available size passed in the previous layout pass, if any.

    Source

    previous_arrange

    fn previous_arrange(self: &Self) -> Option<Rect>
    

    The rect passed in the previous layout pass, if any.

    Source

    measure

    fn measure(self: &Self, available_size: Size)
    

    Carries out a measure of the control.

    Source

    measure_hold

    fn measure_hold(self: &Self) -> Option<crate::layout::MeasureHold>
    

    The available sizes over which the last measure of the element holds, if any (section 9.15 of desktop-performance.md): a panel whose children's constraints follow its own reads its children's holds to compute its own.

    Source

    arrange

    fn arrange(self: &Self, rect: Rect)
    

    Arranges the control and its children.

    Source

    invalidate_measure

    fn invalidate_measure(self: &Self)
    

    Invalidates the measurement of the control and queues a new layout pass.

    Source

    invalidate_arrange

    fn invalidate_arrange(self: &Self)
    

    Invalidates the arrangement of the control and queues a new layout pass.

    Source

    affects_measure

    fn affects_measure<T: ObjectType + Upcast<Layoutable>>(properties: &[&'static FerroProperty])
    

    Marks a property as affecting the control's measurement: after a change to any of the properties on an object of class T, invalidate_measure is called on it.

    Source

    affects_arrange

    fn affects_arrange<T: ObjectType + Upcast<Layoutable>>(properties: &[&'static FerroProperty])
    

    Marks a property as affecting the control's arrangement: after a change to any of the properties on an object of class T, invalidate_arrange is called on it.

    Source

    Trait implementations

    Availability

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