pub struct ClampLayoutBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct ClampLayout objects.

Implementations§

source§

impl ClampLayoutBuilder

source

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

The maximum size to allocate to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

source

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

The size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

source

pub fn unit(self, unit: LengthUnit) -> Self

Available on crate feature v1_4 only.

The length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

source

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

The orientation of the orientable.

source

pub fn build(self) -> ClampLayout

Build the ClampLayout.

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>,

§

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>,

§

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.