Struct libbismuth::builders::LatchLayoutBuilder
source · pub struct LatchLayoutBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct LatchLayout
objects.
Implementations§
source§impl LatchLayoutBuilder
impl LatchLayoutBuilder
sourcepub fn maximum_size(self, maximum_size: i32) -> Self
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.
sourcepub fn tightening_threshold(self, tightening_threshold: i32) -> Self
pub fn tightening_threshold(self, tightening_threshold: i32) -> Self
The size above which the children are latched.
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.
sourcepub fn build(self) -> LatchLayout
pub fn build(self) -> LatchLayout
Build the LatchLayout
.