Trait unsegen::widget::widget::WidgetExt[][src]

pub trait WidgetExt: Widget + Sized {
    fn centered(self) -> Centered<Self> { ... }
fn with_window<F: Fn(Window<'_>, RenderingHints) -> Window<'_>>(
        self,
        f: F
    ) -> WithWindow<Self, F> { ... }
fn with_demand<F: Fn(Demand2D) -> Demand2D>(
        self,
        f: F
    ) -> WithDemand<Self, F> { ... } }
Expand description

An extension trait to Widget which access to convenience methods that alters the behavior of the wrapped widgets.

Provided methods

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.

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.

Implementors

impl<W: Widget + Sized> WidgetExt for W[src]