pub struct WrapLayoutBuilder { /* private fields */ }
v1_7
only.Expand description
A builder-pattern type to construct WrapLayout
objects.
Implementations§
source§impl WrapLayoutBuilder
impl WrapLayoutBuilder
sourcepub fn align(self, align: f32) -> Self
pub fn align(self, align: f32) -> Self
The alignment of the children within each line.
0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.
Alignment is only used when justify
is set to
ADW_JUSTIFY_NONE
, or on the last line when the
justify-last-line
is FALSE
.
sourcepub fn child_spacing(self, child_spacing: i32) -> Self
pub fn child_spacing(self, child_spacing: i32) -> Self
The spacing between widgets on the same line.
See child-spacing-unit
.
sourcepub fn child_spacing_unit(self, child_spacing_unit: LengthUnit) -> Self
pub fn child_spacing_unit(self, child_spacing_unit: LengthUnit) -> Self
The length unit for child spacing.
Allows the spacing to vary depending on the text scale factor.
See child-spacing
.
sourcepub fn justify(self, justify: JustifyMode) -> Self
pub fn justify(self, justify: JustifyMode) -> Self
Determines whether and how each complete line should be stretched to fill the entire widget.
If set to ADW_JUSTIFY_FILL
, each widget in the line will be stretched,
keeping consistent spacing, so that the line fills the entire widget.
If set to ADW_JUSTIFY_SPREAD
, the spacing between widgets will be
increased, keeping widget sizes intact. The first and last widget will be
aligned with the beginning and end of the line. If the line only contains a
single widget, it will be stretched regardless.
If set to ADW_JUSTIFY_NONE
, the line will not be stretched and the
children will be placed together within the line, according to
align
.
By default this doesn’t affect the last line, as it will be incomplete. Use
justify-last-line
to justify it as well.
sourcepub fn justify_last_line(self, justify_last_line: bool) -> Self
pub fn justify_last_line(self, justify_last_line: bool) -> Self
Whether the last line should be stretched to fill the entire widget.
See justify
.
sourcepub fn line_homogeneous(self, line_homogeneous: bool) -> Self
pub fn line_homogeneous(self, line_homogeneous: bool) -> Self
Whether all lines should take the same amount of space.
sourcepub fn line_spacing(self, line_spacing: i32) -> Self
pub fn line_spacing(self, line_spacing: i32) -> Self
The spacing between lines.
See line-spacing-unit
.
sourcepub fn line_spacing_unit(self, line_spacing_unit: LengthUnit) -> Self
pub fn line_spacing_unit(self, line_spacing_unit: LengthUnit) -> Self
The length unit for line spacing.
Allows the spacing to vary depending on the text scale factor.
See line-spacing
.
sourcepub fn natural_line_length(self, natural_line_length: i32) -> Self
pub fn natural_line_length(self, natural_line_length: i32) -> Self
Determines the natural size for each line.
It should be used to limit the line lengths, for example when used in popovers.
sourcepub fn natural_line_length_unit(
self,
natural_line_length_unit: LengthUnit,
) -> Self
pub fn natural_line_length_unit( self, natural_line_length_unit: LengthUnit, ) -> Self
The length unit for natural line length.
Allows the length to vary depending on the text scale factor.
See natural-line-length
.
sourcepub fn pack_direction(self, pack_direction: PackDirection) -> Self
pub fn pack_direction(self, pack_direction: PackDirection) -> Self
The direction children are packed in each line.
sourcepub fn wrap_policy(self, wrap_policy: WrapPolicy) -> Self
pub fn wrap_policy(self, wrap_policy: WrapPolicy) -> Self
Whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the end
in a vertical box. If set to TRUE
, they wrap upwards or towards the start
respectively.
sourcepub fn wrap_reverse(self, wrap_reverse: bool) -> Self
pub fn wrap_reverse(self, wrap_reverse: bool) -> Self
Whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the end
in a vertical box. If set to TRUE
, they wrap upwards or towards the start
respectively.
sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
The orientation of the orientable.
sourcepub fn build(self) -> WrapLayout
pub fn build(self) -> WrapLayout
Build the WrapLayout
.