Skip to main content

PopoverScope

Struct PopoverScope 

Source
pub struct PopoverScope<'a> { /* private fields */ }
Expand description

A Popover and its builder.

Implementations§

Source§

impl<'a> PopoverScope<'a>

Source

pub fn on_dismiss(self, handler: impl FnMut() + 'static) -> Self

Called once when the user presses outside the box or presses Escape.

Source

pub fn placement(self, placement: PopoverPlacement) -> Self

The side of the anchor the box opens on. Bottom when it is not said.

Source

pub fn align(self, align: PopoverAlign) -> Self

The edge of the anchor the box lines up with. Start when it is not said.

Source

pub fn offset(self, dp: f32) -> Self

The gap between the anchor and the box, in dp. The design system’s gap when it is not said.

Source

pub fn scrim(self, scrim: bool) -> Self

Whether the window behind the box is dimmed while it is open. It is not, unless asked.

Source

pub fn scrim_color(self, paint: impl Into<Paint>) -> Self

Dims the window behind the box with this colour instead of the design system’s.

Source

pub fn anchor(self, anchor: impl FnOnce() + 'a) -> Self

The widget the box is attached to. It is the first child on the wire.

Source§

impl<'a> PopoverScope<'a>

Source

pub fn modifier(self, modifier: Modifier) -> Self

What sits around it. Compose’s modifier parameter.

Source§

impl<'a> PopoverScope<'a>

Source

pub fn content(self, content: impl FnOnce())

Composes this widget with content as its children.

Trait Implementations§

Source§

impl<'a> Drop for PopoverScope<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PopoverScope<'a>

§

impl<'a> !Send for PopoverScope<'a>

§

impl<'a> !Sync for PopoverScope<'a>

§

impl<'a> !UnwindSafe for PopoverScope<'a>

§

impl<'a> Forget for PopoverScope<'a>

§

impl<'a> Freeze for PopoverScope<'a>

§

impl<'a> Move for PopoverScope<'a>

§

impl<'a> Unpin for PopoverScope<'a>

§

impl<'a> UnsafeUnpin for PopoverScope<'a>

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.