Skip to main content

ZStack

Struct ZStack 

Source
pub struct ZStack<Seq> { /* private fields */ }
Expand description

A view container that lays the child widgets on top of each other.

See zstack for more details.

Implementations§

Source§

impl<Seq> ZStack<Seq>

Source

pub fn alignment(self, alignment: impl Into<UnitPoint>) -> Self

Changes the alignment of the children.

Trait Implementations§

Source§

impl<State, Action, Seq> View<State, Action, ViewCtx> for ZStack<Seq>
where State: 'static, Action: 'static, Seq: ZStackSequence<State, Action>,

Source§

type Element = Pod<ZStack>

The element type which this view operates on.
Source§

type ViewState = ZStackState<<Seq as ViewSequence<State, Action, ViewCtx, ZStackElement>>::SeqState>

State that is used over the lifetime of the retained representation of the view. Read more
Source§

fn build( &self, ctx: &mut ViewCtx, app_state: &mut State, ) -> (Self::Element, Self::ViewState)

Create the corresponding Element value.
Source§

fn rebuild( &self, prev: &Self, _: &mut Self::ViewState, ctx: &mut ViewCtx, element: Mut<'_, Self::Element>, app_state: &mut State, )

Update element based on the difference between self and prev.
Source§

fn teardown( &self, _: &mut Self::ViewState, ctx: &mut ViewCtx, element: Mut<'_, Self::Element>, )

Handle element being removed from the tree. Read more
Source§

fn message( &self, _: &mut Self::ViewState, message: &mut MessageContext, element: Mut<'_, Self::Element>, app_state: &mut State, ) -> MessageResult<Action>

Route message to id_path, if that is still a valid path.
Source§

impl<Seq> ViewMarker for ZStack<Seq>

Auto Trait Implementations§

§

impl<Seq> Freeze for ZStack<Seq>
where Seq: Freeze,

§

impl<Seq> RefUnwindSafe for ZStack<Seq>
where Seq: RefUnwindSafe,

§

impl<Seq> Send for ZStack<Seq>
where Seq: Send,

§

impl<Seq> Sync for ZStack<Seq>
where Seq: Sync,

§

impl<Seq> Unpin for ZStack<Seq>
where Seq: Unpin,

§

impl<Seq> UnsafeUnpin for ZStack<Seq>
where Seq: UnsafeUnpin,

§

impl<Seq> UnwindSafe for ZStack<Seq>
where Seq: UnwindSafe,

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<State, Action, Context, DynamicElement, V> AnyView<State, Action, Context, DynamicElement> for V
where DynamicElement: AnyElement<<V as View<State, Action, Context>>::Element, Context>, Context: ViewPathTracker, V: View<State, Action, Context> + 'static, <V as View<State, Action, Context>>::ViewState: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Get an Any reference to self.
Source§

fn dyn_build( &self, ctx: &mut Context, app_state: &mut State, ) -> (DynamicElement, AnyViewState)

Type erased View::build.
Source§

fn dyn_rebuild( &self, dyn_state: &mut AnyViewState, ctx: &mut Context, prev: &dyn AnyView<State, Action, Context, DynamicElement>, element: <DynamicElement as ViewElement>::Mut<'_>, app_state: &mut State, )

Type erased View::rebuild.
Source§

fn dyn_teardown<'el>( &self, dyn_state: &mut AnyViewState, ctx: &mut Context, element: <DynamicElement as ViewElement>::Mut<'el>, ) -> <DynamicElement as ViewElement>::Mut<'el>

Source§

fn dyn_message( &self, dyn_state: &mut AnyViewState, message: &mut MessageContext, element: <DynamicElement as ViewElement>::Mut<'_>, app_state: &mut State, ) -> MessageResult<Action>

Type erased View::message.
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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<State, Action, V> FlexExt<State, Action> for V
where V: WidgetView<State, Action>,

Source§

fn flex(self, params: impl Into<FlexParams>) -> FlexItem<Self, State, Action>
where State: 'static, Action: 'static, Self: Sized,

Applies impl Into<FlexParams> to this view, can be used as child of a Flex View Read more
Source§

fn into_any_flex(self) -> AnyFlexChild<State, Action>
where State: 'static, Action: 'static, Self: Sized,

Turns this WidgetView into an AnyFlexChild, which can be used interchangeably with an FlexSpacer, as child of a Flex View Read more
Source§

impl<Seq, State, Action> FlexSequence<State, Action> for Seq
where Seq: ViewSequence<State, Action, ViewCtx, FlexElement>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<State, Action, V> GridExt<State, Action> for V
where V: WidgetView<State, Action>,

Source§

fn grid_item( self, params: impl Into<GridParams>, ) -> GridItem<Self, State, Action>
where State: 'static, Action: 'static, Self: Sized,

Applies impl Into<GridParams> to this view. This allows the view to be placed as a child within a Grid View. Read more
Source§

fn grid_pos(self, x: i32, y: i32) -> GridItem<Self, State, Action>
where State: 'static, Action: 'static, Self: Sized,

Applies a impl Into<GridParams> with the specified position to this view. This allows the view to be placed as a child within a Grid View. For instances where a grid item is expected to take up multiple cell units, use GridExt::grid_item Read more
Source§

impl<Seq, State, Action> GridSequence<State, Action> for Seq
where Seq: ViewSequence<State, Action, ViewCtx, GridElement>,

Source§

impl<Seq, State, Action> IndexedStackSequence<State, Action> for Seq
where Seq: ViewSequence<State, Action, ViewCtx, IndexedStackElement>,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<State, Action, V> Style<State, Action> for V
where State: 'static, Action: 'static, V: WidgetView<State, Action>,

Source§

fn color(self, color: Color) -> Prop<ContentColor, Self, State, Action>

Set the element’s content color. Read more
Source§

fn disabled_color( self, color: Color, ) -> Prop<DisabledContentColor, Self, State, Action>

Set the element’s content color when disabled. Read more
Source§

fn background( self, background: Background, ) -> Prop<Background, Self, State, Action>

Set the element’s background to a color/gradient.
Source§

fn background_color(self, color: Color) -> Prop<Background, Self, State, Action>

Set the element’s background to a color.
Source§

fn background_gradient( self, gradient: Gradient, ) -> Prop<Background, Self, State, Action>

Set the element’s background to a gradient.
Source§

fn active_background( self, background: Background, ) -> Prop<ActiveBackground, Self, State, Action>

Set the element’s background when pressed to a color/gradient.
Source§

fn active_background_color( self, color: Color, ) -> Prop<ActiveBackground, Self, State, Action>

Set the element’s background when pressed to a color.
Source§

fn active_background_gradient( self, gradient: Gradient, ) -> Prop<ActiveBackground, Self, State, Action>

Set the element’s background when pressed to a gradient.
Source§

fn disabled_background( self, background: Background, ) -> Prop<DisabledBackground, Self, State, Action>

Set the element’s background when disabled to a color/gradient.
Source§

fn disabled_background_color( self, color: Color, ) -> Prop<DisabledBackground, Self, State, Action>

Set the element’s background when disabled to a color.
Source§

fn disabled_background_gradient( self, gradient: Gradient, ) -> Prop<DisabledBackground, Self, State, Action>

Set the element’s background when disabled to a gradient.
Source§

fn border( self, color: Color, width: f64, ) -> Prop<BorderWidth, Prop<BorderColor, Self, State, Action>, State, Action>

Set the element’s border color and width.
Source§

fn border_color(self, color: Color) -> Prop<BorderColor, Self, State, Action>

Set the element’s border color.
Source§

fn hovered_border_color( self, color: Color, ) -> Prop<HoveredBorderColor, Self, State, Action>

Set the element’s border color when hovered.
Source§

fn border_width(self, width: f64) -> Prop<BorderWidth, Self, State, Action>

Set the element’s border width.
Source§

fn box_shadow( self, box_shadow: BoxShadow, ) -> Prop<BoxShadow, Self, State, Action>

Set the element’s box shadow.
Source§

fn corner_radius(self, radius: f64) -> Prop<CornerRadius, Self, State, Action>

Set the element’s corner radius.
Source§

fn padding( self, padding: impl Into<Padding>, ) -> Prop<Padding, Self, State, Action>
where Self::Widget: HasProperty<Padding>,

Set the element’s padding.
Source§

fn line_break_mode( self, line_break_mode: LineBreaking, ) -> Prop<LineBreaking, Self, State, Action>

Set how line breaks will be handled when text overflows the available space.
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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<V, State, Action, W> WidgetView<State, Action> for V
where V: View<State, Action, ViewCtx, Element = Pod<W>> + Send + Sync, W: Widget + FromDynWidget + ?Sized,

Source§

type Widget = W

Source§

fn boxed(self) -> Box<AnyWidgetView<State, Action>>
where State: 'static, Action: 'static, Self: Sized,

Returns a boxed type erased AnyWidgetView Read more
Source§

fn transform(self, by: Affine) -> Transformed<Self, State, Action>
where Self: Sized,

This widget with a 2d transform applied. Read more
Source§

fn prop<P>(self, property: P) -> Prop<P, Self, State, Action>
where State: 'static, Action: 'static, Self: Sized, Self::Widget: HasProperty<P>, P: Property + PartialEq + Clone,

Set a Property on this view, when the underlying widget supports it. Read more
Source§

impl<Seq, State, Action> WidgetViewSequence<State, Action> for Seq
where Seq: ViewSequence<State, Action, ViewCtx, Pod<dyn Widget>>,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<State, Action, V> ZStackExt<State, Action> for V
where V: WidgetView<State, Action>,

Source§

fn alignment( self, alignment: impl Into<ChildAlignment>, ) -> ZStackItem<Self, State, Action>
where State: 'static, Action: 'static, Self: Sized,

Applies ChildAlignment to this view. This allows the view to override the default alignment of the parent ZStack. This can only be used on views that are direct children of a ZStack.
Source§

impl<Seq, State, Action> ZStackSequence<State, Action> for Seq
where Seq: ViewSequence<State, Action, ViewCtx, ZStackElement>,