ConstrainedBoxWidget

Struct ConstrainedBoxWidget 

Source
pub struct ConstrainedBoxWidget { /* private fields */ }

Trait Implementations§

Source§

impl Debug for ConstrainedBoxWidget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Widget for ConstrainedBoxWidget

Source§

type Props<'a> = ConstrainedBox

The props that this widget needs to be created or updated. Props define all of the values that a widget’s user can specify every render.
Source§

type Response = ()

The type that the widget will return to the user when it is created or updated. This type should contain information like whether the widget was clicked, had keyboard input, or other info that might be useful.
Source§

fn new() -> Self

Create the widget.
Source§

fn update(&mut self, props: Self::Props<'_>) -> Self::Response

Update the widget with new props.
Source§

fn layout(&self, ctx: LayoutContext<'_>, input: Constraints) -> Vec2

Calculate this widget’s layout with the given constraints and return its size. The returned size must fit within the given constraints, which can be done using constraints.constrain(size). Read more
Source§

fn flex(&self) -> (u32, FlexFit)

Returns whether this widget should grow to fill a flexible layout, and if so, what weight should be applied to it if other widgets also want to grow. Read more
Source§

fn flow(&self) -> Flow

Returns the behavior that this widget should have when part of a layout. Read more
Source§

fn default_layout( &self, ctx: LayoutContext<'_>, constraints: Constraints, ) -> Vec2

A convenience method that always performs the default layout strategy for a widget. This method is intended to be called from custom widget’s layout methods.
Source§

fn paint(&self, ctx: PaintContext<'_>)

Paint the widget based on its current state. Read more
Source§

fn default_paint(&self, ctx: PaintContext<'_>)

A convenience method that always performs the default painting operation for a widget. This method is intended to be called from custom widget’s paint methods.
Source§

fn event_interest(&self) -> EventInterest

Tells which events the widget is interested in receiving. Read more
Source§

fn event(&mut self, ctx: EventContext<'_>, event: &WidgetEvent) -> EventResponse

Handle the given event and update the widget’s state. Read more
Source§

fn navigate( &self, ctx: NavigateContext<'_>, dir: NavDirection, ) -> Option<WidgetId>

Tell which widget should be navigated to if the user navigates in a given direction.

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> ErasedWidget for T
where T: Widget,

Source§

fn layout(&self, ctx: LayoutContext<'_>, constraints: Constraints) -> Vec2

Source§

fn flex(&self) -> (u32, FlexFit)

Source§

fn flow(&self) -> Flow

Source§

fn paint(&self, ctx: PaintContext<'_>)

Source§

fn event_interest(&self) -> EventInterest

Source§

fn event(&mut self, ctx: EventContext<'_>, event: &WidgetEvent) -> EventResponse

Source§

fn type_name(&self) -> &'static str

Returns the type name of the widget, usable only for debugging.
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>,

Source§

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

Source§

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.
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> Props for T
where T: Debug,