Layoutable
struct · ferroui-base · v0.5.0
struct Layoutable
Implements layout-related functionality for a control.
Members
TYPEto_refapply_templatemeasure_coremeasure_overridemeasure_hold_overridearrange_corearrange_overrideon_measure_invalidateddesired_size_propertywidth_propertyheight_propertymin_width_propertymax_width_propertymin_height_propertymax_height_propertymargin_propertyhorizontal_alignment_propertyvertical_alignment_propertyuse_layout_rounding_propertyconstructneweffective_viewport_changedlayout_updatedupdate_layoutwidthset_widthheightset_heightmin_widthset_min_widthmax_widthset_max_widthmin_heightset_min_heightmax_heightset_max_heightmarginset_marginhorizontal_alignmentset_horizontal_alignmentvertical_alignmentset_vertical_alignmentdesired_sizeis_measure_validis_arrange_validuse_layout_roundingset_use_layout_roundingprevious_measureprevious_arrangemeasuremeasure_holdarrangeinvalidate_measureinvalidate_arrangeaffects_measureaffects_arrange
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Layoutable>
Returns a strong reference to this object.
apply_template
fn apply_template(self: &Self)
Creates the visual children of the control, if necessary.
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.
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.
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.
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.
arrange_override
fn arrange_override(self: &Self, final_size: Size) -> Size
Positions child elements as part of a layout pass. Returns the size used.
on_measure_invalidated
fn on_measure_invalidated(self: &Self)
Called by invalidate_measure.
desired_size_property
fn desired_size_property() -> &'static DirectProperty<Layoutable, Size>
Defines the DesiredSize property.
width_property
fn width_property() -> &'static StyledProperty<f64>
Defines the Width property.
height_property
fn height_property() -> &'static StyledProperty<f64>
Defines the Height property.
min_width_property
fn min_width_property() -> &'static StyledProperty<f64>
Defines the MinWidth property.
max_width_property
fn max_width_property() -> &'static StyledProperty<f64>
Defines the MaxWidth property.
min_height_property
fn min_height_property() -> &'static StyledProperty<f64>
Defines the MinHeight property.
max_height_property
fn max_height_property() -> &'static StyledProperty<f64>
Defines the MaxHeight property.
margin_property
fn margin_property() -> &'static StyledProperty<Thickness>
Defines the Margin property.
horizontal_alignment_property
fn horizontal_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
Defines the HorizontalAlignment property.
vertical_alignment_property
fn vertical_alignment_property() -> &'static StyledProperty<VerticalAlignment>
Defines the VerticalAlignment property.
use_layout_rounding_property
fn use_layout_rounding_property() -> &'static StyledProperty<bool>
Defines the UseLayoutRounding property.
construct
fn construct() -> Self
Creates the class data; see crate::FerroObject::construct.
new
fn new() -> Ref<Self>
effective_viewport_changed
fn effective_viewport_changed(self: &Self, handler: impl Fn(&EffectiveViewportChangedEventArgs) -> () + 'static) -> Subscription
Occurs when the element's effective viewport changes.
layout_updated
fn layout_updated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
Occurs when a layout pass completes for the control.
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.
width
fn width(self: &Self) -> f64
The width of the element.
set_width
fn set_width(self: &Self, value: f64)
height
fn height(self: &Self) -> f64
The height of the element.
set_height
fn set_height(self: &Self, value: f64)
min_width
fn min_width(self: &Self) -> f64
The minimum width of the element.
set_min_width
fn set_min_width(self: &Self, value: f64)
max_width
fn max_width(self: &Self) -> f64
The maximum width of the element.
set_max_width
fn set_max_width(self: &Self, value: f64)
min_height
fn min_height(self: &Self) -> f64
The minimum height of the element.
set_min_height
fn set_min_height(self: &Self, value: f64)
max_height
fn max_height(self: &Self) -> f64
The maximum height of the element.
set_max_height
fn set_max_height(self: &Self, value: f64)
margin
fn margin(self: &Self) -> Thickness
The margin around the element.
set_margin
fn set_margin(self: &Self, value: Thickness)
horizontal_alignment
fn horizontal_alignment(self: &Self) -> HorizontalAlignment
The element's preferred horizontal alignment in its parent.
set_horizontal_alignment
fn set_horizontal_alignment(self: &Self, value: HorizontalAlignment)
vertical_alignment
fn vertical_alignment(self: &Self) -> VerticalAlignment
The element's preferred vertical alignment in its parent.
set_vertical_alignment
fn set_vertical_alignment(self: &Self, value: VerticalAlignment)
desired_size
fn desired_size(self: &Self) -> Size
The size that this element computed during the measure pass of the layout process.
is_measure_valid
fn is_measure_valid(self: &Self) -> bool
Whether the control's layout measure is valid.
is_arrange_valid
fn is_arrange_valid(self: &Self) -> bool
Whether the control's layout arrange is valid.
use_layout_rounding
fn use_layout_rounding(self: &Self) -> bool
Whether the control's layout should be snapped to pixel boundaries.
set_use_layout_rounding
fn set_use_layout_rounding(self: &Self, value: bool)
previous_measure
fn previous_measure(self: &Self) -> Option<Size>
The available size passed in the previous layout pass, if any.
previous_arrange
fn previous_arrange(self: &Self) -> Option<Rect>
The rect passed in the previous layout pass, if any.
measure
fn measure(self: &Self, available_size: Size)
Carries out a measure of the control.
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.
arrange
fn arrange(self: &Self, rect: Rect)
Arranges the control and its children.
invalidate_measure
fn invalidate_measure(self: &Self)
Invalidates the measurement of the control and queues a new layout pass.
invalidate_arrange
fn invalidate_arrange(self: &Self)
Invalidates the arrangement of the control and queues a new layout pass.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyErasedDestructorIntoEitherDerefUpcast<T>Upcast<Layoutable>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplStyledElementImplVisualImplLayoutableImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.