pub struct DialogState { /* private fields */ }Expand description
Retains one modal’s focus scope and the focus to restore on close.
Implementations§
Source§impl DialogState
impl DialogState
pub fn new(cx: &mut Context<'_, DialogState>) -> DialogState
pub fn is_open(&self) -> bool
Sourcepub fn open(&mut self, window: &mut Window, cx: &mut Context<'_, DialogState>)
pub fn open(&mut self, window: &mut Window, cx: &mut Context<'_, DialogState>)
Focuses the modal container. A caller can then focus a child editor.
Sourcepub fn close(&mut self, window: &mut Window, cx: &mut Context<'_, DialogState>)
pub fn close(&mut self, window: &mut Window, cx: &mut Context<'_, DialogState>)
Closes the modal and restores the previous focus if its handle still exists.
Auto Trait Implementations§
impl !RefUnwindSafe for DialogState
impl !Send for DialogState
impl !Sync for DialogState
impl !UnwindSafe for DialogState
impl Forget for DialogState
impl Freeze for DialogState
impl Move for DialogState
impl Unpin for DialogState
impl UnsafeUnpin for DialogState
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