#[repr(C)]pub struct Popover {
pub popover_state: PopoverStateWrapper,
pub anchor: Dom,
pub content: Dom,
pub wrapper_style: CssPropertyWithConditionsVec,
pub content_style: CssPropertyWithConditionsVec,
}Expand description
A click-triggered floating panel anchored to an arbitrary Dom.
Fields§
§popover_state: PopoverStateWrapperRuntime state (open) plus the optional toggle callback.
anchor: DomThe element that, when clicked, toggles the panel.
content: DomThe content shown inside the floating panel.
wrapper_style: CssPropertyWithConditionsVecStyle of the positioning wrapper around the trigger + panel.
content_style: CssPropertyWithConditionsVecStyle of the floating content panel (includes its current display).
Implementations§
Source§impl Popover
impl Popover
Sourcepub fn new(anchor: Dom, content: Dom) -> Self
pub fn new(anchor: Dom, content: Dom) -> Self
Creates a popover whose anchor, when clicked, toggles a panel holding
content. The panel starts closed.
Sourcepub fn set_open(&mut self, open: bool)
pub fn set_open(&mut self, open: bool)
Sets whether the panel starts open, recomputing the panel style.
Sourcepub fn set_on_toggle<C: Into<PopoverOnToggleCallback>>(
&mut self,
data: RefAny,
on_toggle: C,
)
pub fn set_on_toggle<C: Into<PopoverOnToggleCallback>>( &mut self, data: RefAny, on_toggle: C, )
Sets the toggle callback (invoked with the new state on every toggle).
Sourcepub fn with_on_toggle<C: Into<PopoverOnToggleCallback>>(
self,
data: RefAny,
on_toggle: C,
) -> Self
pub fn with_on_toggle<C: Into<PopoverOnToggleCallback>>( self, data: RefAny, on_toggle: C, ) -> Self
Builder-style setter for the toggle callback.
Sourcepub fn swap_with_default(&mut self) -> Self
pub fn swap_with_default(&mut self) -> Self
Replaces self with a default (empty) popover and returns the original.
Trait Implementations§
impl Eq for Popover
impl StructuralPartialEq for Popover
Auto Trait Implementations§
impl Freeze for Popover
impl RefUnwindSafe for Popover
impl Send for Popover
impl Sync for Popover
impl Unpin for Popover
impl UnsafeUnpin for Popover
impl UnwindSafe for Popover
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more