pub struct PopoverState { /* private fields */ }Expand description
Owns one popover’s open state, disabled state, trigger, and content focus.
Keep its matching Popover mounted while closed. Opening focuses the
supplied initial control, or the content scope. Escape and imperative close
restore the trigger while focus belongs to the popup. Leaving the popup by
pointer or keyboard preserves the new focus target.
Implementations§
Source§impl PopoverState
impl PopoverState
pub fn new(cx: &mut Context<'_, Self>) -> Self
Sourcepub fn with_initial_focus(self, focus: &FocusHandle) -> Self
pub fn with_initial_focus(self, focus: &FocusHandle) -> Self
Chooses a control rendered inside the content for initial focus.
pub fn is_open(&self) -> bool
pub fn is_disabled(&self) -> bool
Sourcepub fn focus_handle(&self) -> &FocusHandle
pub fn focus_handle(&self) -> &FocusHandle
The trigger’s focus handle.
Sourcepub fn content_focus_handle(&self) -> &FocusHandle
pub fn content_focus_handle(&self) -> &FocusHandle
The content’s non-modal focus scope, excluded from ordinary Tab order.
pub fn set_disabled( &mut self, disabled: bool, window: &mut Window, cx: &mut Context<'_, Self>, )
pub fn open(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Auto Trait Implementations§
impl !RefUnwindSafe for PopoverState
impl !Send for PopoverState
impl !Sync for PopoverState
impl !UnwindSafe for PopoverState
impl Forget for PopoverState
impl Freeze for PopoverStatewhere
NonZero<u32>: Freeze,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: Freeze,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: Freeze,
*const dyn Fn(&mut Window, &mut App) -> FocusHandle is !null: Freeze,
PhantomData<dyn Fn(&mut Window, &mut App) -> FocusHandle>: Freeze,
*const RcInner<()> is !null: Freeze,
PhantomData<RcInner<()>>: Freeze,
*const dyn FnOnce() is !null: Freeze,
PhantomData<dyn FnOnce()>: Freeze,
impl Move for PopoverState
impl Unpin for PopoverState
impl UnsafeUnpin for PopoverStatewhere
NonZeroU32Inner: UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: UnsafeUnpin,
*const dyn Fn(&mut Window, &mut App) -> FocusHandle is !null: UnsafeUnpin,
PhantomData<dyn Fn(&mut Window, &mut App) -> FocusHandle>: UnsafeUnpin,
*const RcInner<()> is !null: UnsafeUnpin,
PhantomData<RcInner<()>>: UnsafeUnpin,
*const dyn FnOnce() is !null: UnsafeUnpin,
PhantomData<dyn FnOnce()>: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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