[][src]Struct kas::layout::SizeRules

pub struct SizeRules { /* fields omitted */ }

Widget sizing information

Return value of kas::Layout::size_rules.

This struct conveys properties such as the minimum size and preferred size of the widgets being queried.

Methods

impl SizeRules[src]

pub const EMPTY: Self[src]

Empty (zero size)

pub fn fixed(size: u32) -> Self[src]

A fixed size

pub fn new(min: u32, ideal: u32, stretch: StretchPolicy) -> Self[src]

Construct with custom rules

Region size should meet the given min-imum size and has a given ideal size, plus a given stretch policy.

Required: ideal >= min (if not, ideal is clamped to min).

pub fn max(self, rhs: Self) -> SizeRules[src]

Use the maximum size of self and rhs.

pub fn min_size(self) -> u32[src]

Get the minimum size

pub fn ideal_size(self) -> u32[src]

Get the ideal size

pub fn set_at_least_op_sub(&mut self, x: Self, y: Self)[src]

Like self = self.max(x - y) but handling negative values correctly

pub fn reduce_min_to(&mut self, min: u32)[src]

Reduce the minimum size

If min is greater than the current minimum size, this has no effect.

Trait Implementations

impl Add<SizeRules> for SizeRules[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<u32> for SizeRules[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<SizeRules> for SizeRules[src]

impl Clone for SizeRules[src]

impl Copy for SizeRules[src]

impl Debug for SizeRules[src]

impl Default for SizeRules[src]

impl Mul<u32> for SizeRules[src]

type Output = Self

The resulting type after applying the * operator.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.