Struct unsegen::widget::widget::WithDemand[][src]

pub struct WithDemand<W, F>(_, _);
Expand description

Alter the reported demand of the widget. This can be useful, for example, to force a widget to assume all space in the window or to artificially restrict the size of a widget.

This wrapper can be created using WidgetExt::centered.

Trait Implementations

impl<W: Widget, F: Fn(Demand2D) -> Demand2D> Widget for WithDemand<W, F>[src]

fn space_demand(&self) -> Demand2D[src]

Return the current demand for (rectangular) screen estate. Read more

fn draw(&self, window: Window<'_>, hints: RenderingHints)[src]

Draw the widget to the given window. Read more

Auto Trait Implementations

impl<W, F> RefUnwindSafe for WithDemand<W, F> where
    F: RefUnwindSafe,
    W: RefUnwindSafe

impl<W, F> Send for WithDemand<W, F> where
    F: Send,
    W: Send

impl<W, F> Sync for WithDemand<W, F> where
    F: Sync,
    W: Sync

impl<W, F> Unpin for WithDemand<W, F> where
    F: Unpin,
    W: Unpin

impl<W, F> UnwindSafe for WithDemand<W, F> where
    F: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<W> WidgetExt for W where
    W: Widget
[src]

fn centered(self) -> Centered<Self>[src]

Center the widget according to the specified maximum demand within the supplied window. This is only useful if the widget has a defined maximum size and the window is larger than that. Read more

fn with_window<F: Fn(Window<'_>, RenderingHints) -> Window<'_>>(
    self,
    f: F
) -> WithWindow<Self, F>
[src]

Alter the window before letting the widget draw itself in it.

fn with_demand<F: Fn(Demand2D) -> Demand2D>(self, f: F) -> WithDemand<Self, F>[src]

Alter the reported demand of the widget. This can be useful, for example, to force a widget to assume all space in the window or to artificially restrict the size of a widget. Read more