pub struct DialogState { /* private fields */ }Expand description
Owns a dialog’s open state, stable focus scope and return target.
Keep the matching Dialog mounted while closed. Opening focuses the
supplied initial control, or the dialog scope if none was supplied. Closing
restores the previous live focus target only while focus still belongs to
this dialog; it never steals focus back from another surface.
Implementations§
Source§impl DialogState
impl DialogState
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 dialog for initial focus.
pub fn is_open(&self) -> bool
pub fn focus_handle(&self) -> &FocusHandle
pub fn open(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
pub fn close(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Trait Implementations§
impl EventEmitter<DialogEvent> for DialogState
Auto Trait Implementations§
impl !RefUnwindSafe for DialogState
impl !UnwindSafe for DialogState
impl Forget for DialogState
impl Freeze for DialogState
impl Move for DialogState
impl Send for DialogState
impl Sync for DialogState
impl Unpin for DialogState
impl UnsafeUnpin for DialogStatewhere
NonZeroU32Inner: UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: 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