LayoutControl
Inherits: Control
Properties
-
align(Alignment | None) –Alignment of the control within its parent.
-
animate_align(AnimationValue | None) –Enables implicit animation of the
alignproperty. -
animate_margin(AnimationValue | None) –Enables implicit animation of the
marginproperty. -
animate_offset(AnimationValue | None) –Enables implicit animation of the
offsetproperty. -
animate_opacity(AnimationValue | None) –Enables implicit animation of the
opacityproperty. -
animate_position(AnimationValue | None) –Enables implicit animation of the positioning properties
-
animate_rotation(AnimationValue | None) –Enables implicit animation of the
rotateproperty. -
animate_scale(AnimationValue | None) –Enables implicit animation of the
scaleproperty. -
animate_size(AnimationValue | None) –TBD
-
aspect_ratio(Number | None) –The aspect ratio of the control.
-
bottom(Number | None) –The distance that the child's bottom edge is inset from the bottom of the stack.
-
height(Number | None) –Imposed Control height in virtual pixels.
-
left(Number | None) –The distance that the child's left edge is inset from the left of the stack.
-
margin(MarginValue | None) –Sets the margin of the control.
-
offset(OffsetValue | None) –Applies a translation transformation before painting the control.
-
right(Number | None) –The distance that the child's right edge is inset from the right of the stack.
-
rotate(RotateValue | None) –Transforms this control using a rotation around its center.
-
scale(ScaleValue | None) –Scales this control along the 2D plane. Default scale factor is
1.0, -
top(Number | None) –The distance that the child's top edge is inset from the top of the stack.
-
width(Number | None) –Imposed Control width in virtual pixels.
Events
-
on_animation_end(ControlEventHandler[LayoutControl] | None) –Called when animation completes.
Properties#
animate_align
#
animate_align: AnimationValue | None = None
animate_margin
#
animate_margin: AnimationValue | None = None
animate_offset
#
animate_offset: AnimationValue | None = None
animate_opacity
#
animate_opacity: AnimationValue | None = None
animate_position
#
animate_position: AnimationValue | None = None
animate_rotation
#
animate_rotation: AnimationValue | None = None
animate_scale
#
animate_scale: AnimationValue | None = None
aspect_ratio
#
aspect_ratio: Number | None = None
The aspect ratio of the control. It is defined as the ratio of the width to the height.
bottom
#
bottom: Number | None = None
The distance that the child's bottom edge is inset from the bottom of the stack.
Note
Effective only if this control is a descendant of one of the following:
Stack control, Page.overlay list.
left
#
left: Number | None = None
The distance that the child's left edge is inset from the left of the stack.
Note
Effective only if this control is a descendant of one of the following:
Stack control, Page.overlay list.
offset
#
offset: OffsetValue | None = None
Applies a translation transformation before painting the control.
The translation is expressed as an Offset scaled to the control's size.
So, Offset(x=0.25, y=0), for example, will result in a horizontal translation
of one quarter the width of this control.
Example
The following example displays container at 0, 0 top left corner of a stack as
transform applies -1 * 100, -1 * 100 (offset * control's size) horizontal and
vertical translations to the control:
right
#
right: Number | None = None
The distance that the child's right edge is inset from the right of the stack.
Note
Effective only if this control is a descendant of one of the following:
Stack control, Page.overlay list.
rotate
#
rotate: RotateValue | None = None
Transforms this control using a rotation around its center.
The value of rotate property could be one of the following types:
number- a rotation in clockwise radians. Full circle360°ismath.pi * 2radians,90°ispi / 2,45°ispi / 4, etc.Rotate- allows to specify rotationangleas well asalignment- the location of rotation center.
scale
#
scale: ScaleValue | None = None
Scales this control along the 2D plane. Default scale factor is 1.0,
meaning no-scale.
Setting this property to 0.5, for example, makes this control twice smaller,
while 2.0 makes it twice larger.
Different scale multipliers can be specified for x and y axis, by setting
Control.scale property to an instance of Scale class.
Either scale or scale_x and scale_y could be specified, but not all of them.
top
#
top: Number | None = None
The distance that the child's top edge is inset from the top of the stack.
Note
Effective only if this control is a descendant of one of the following:
Stack control, Page.overlay list.
Events#
on_animation_end
#
on_animation_end: (
ControlEventHandler[LayoutControl] | None
) = None
Called when animation completes.
Can be used to chain multiple animations.
The data property of the event handler argument contains the name
of the animation.
More information here.