pub struct WithOverlay<W: Widget> { /* private fields */ }Expand description
Wraps a widget with co-located overlay declarations.
Created by the OverlayApi builder methods. Implements Widget and
can be chained with further .dropdown() / .sheet() / .dialog() calls.
Implementations§
Source§impl<W: Widget + 'static> WithOverlay<W>
impl<W: Widget + 'static> WithOverlay<W>
pub fn new(inner: W) -> Self
Sourcepub fn dropdown(
self,
open: Atom<bool>,
content: impl Fn() -> BoxedWidget + Send + Sync + 'static,
) -> Self
pub fn dropdown( self, open: Atom<bool>, content: impl Fn() -> BoxedWidget + Send + Sync + 'static, ) -> Self
Attach a dropdown overlay to this widget.
Sourcepub fn sheet(
self,
open: Atom<bool>,
content: impl Fn() -> BoxedWidget + Send + Sync + 'static,
) -> Self
pub fn sheet( self, open: Atom<bool>, content: impl Fn() -> BoxedWidget + Send + Sync + 'static, ) -> Self
Attach a bottom sheet overlay to this widget.
Sourcepub fn dialog(
self,
open: Atom<bool>,
content: impl Fn() -> BoxedWidget + Send + Sync + 'static,
) -> Self
pub fn dialog( self, open: Atom<bool>, content: impl Fn() -> BoxedWidget + Send + Sync + 'static, ) -> Self
Attach a modal dialog overlay to this widget.
Sourcepub fn rich_tooltip(
self,
content: impl Fn() -> BoxedWidget + Send + Sync + 'static,
) -> Self
pub fn rich_tooltip( self, content: impl Fn() -> BoxedWidget + Send + Sync + 'static, ) -> Self
Attach a CUSTOM-body tooltip overlay to this widget (content-aware:
the closure builds any widget, not just a text label). The everyday
string tooltip is the ergonomic super::WidgetExt::tooltip.
Sourcepub fn toast(
self,
open: Atom<bool>,
content: impl Fn() -> BoxedWidget + Send + Sync + 'static,
) -> Self
pub fn toast( self, open: Atom<bool>, content: impl Fn() -> BoxedWidget + Send + Sync + 'static, ) -> Self
Attach a toast overlay to this widget. Use Toast::show to open it
with auto-dismiss.
Trait Implementations§
Source§impl<W: Widget + Send + Sync + 'static> Widget for WithOverlay<W>
impl<W: Widget + Send + Sync + 'static> Widget for WithOverlay<W>
Source§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl<W> !RefUnwindSafe for WithOverlay<W>
impl<W> !UnwindSafe for WithOverlay<W>
impl<W> Freeze for WithOverlay<W>where
W: Freeze,
impl<W> Send for WithOverlay<W>
impl<W> Sync for WithOverlay<W>
impl<W> Unpin for WithOverlay<W>where
W: Unpin,
impl<W> UnsafeUnpin for WithOverlay<W>where
W: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.