libadwaita::builders

Struct WrapLayoutBuilder

source
pub struct WrapLayoutBuilder { /* private fields */ }
Available on crate feature v1_7 only.
Expand description

A builder-pattern type to construct WrapLayout objects.

Implementations§

source§

impl WrapLayoutBuilder

source

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.

source

pub fn child_spacing(self, child_spacing: i32) -> Self

The spacing between widgets on the same line.

See child-spacing-unit.

source

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.

source

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.

source

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.

source

pub fn line_homogeneous(self, line_homogeneous: bool) -> Self

Whether all lines should take the same amount of space.

source

pub fn line_spacing(self, line_spacing: i32) -> Self

The spacing between lines.

See line-spacing-unit.

source

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.

source

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.

See natural-line-length-unit.

source

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.

source

pub fn pack_direction(self, pack_direction: PackDirection) -> Self

The direction children are packed in each line.

source

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.

source

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.

source

pub fn orientation(self, orientation: Orientation) -> Self

The orientation of the orientable.

source

pub fn build(self) -> WrapLayout

Build the WrapLayout.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.