pub struct DialogRoot { /* private fields */ }Expand description
A Radix-shaped Dialog root configuration surface.
Upstream supports a controlled/uncontrolled open state (open + defaultOpen). In Fret this
maps to either:
- a caller-provided
Model<bool>(controlled), or - an internal
Model<bool>stored in element state (uncontrolled).
Implementations§
Source§impl DialogRoot
impl DialogRoot
pub fn new() -> Self
Sourcepub fn open(self, open: Option<Model<bool>>) -> Self
pub fn open(self, open: Option<Model<bool>>) -> Self
Sets the controlled open model (Some) or selects uncontrolled mode (None).
Sourcepub fn default_open(self, default_open: bool) -> Self
pub fn default_open(self, default_open: bool) -> Self
Sets the uncontrolled initial open value (Radix defaultOpen).
pub fn dismiss_on_overlay_press(self, dismiss_on_overlay_press: bool) -> Self
pub fn initial_focus(self, initial_focus: Option<GlobalElementId>) -> Self
pub fn options(&self) -> DialogOptions
pub fn modal_request_with_dismiss_handler<H: UiHost, I, T>(
&self,
cx: &mut ElementContext<'_, H>,
id: GlobalElementId,
trigger: GlobalElementId,
presence: OverlayPresence,
on_dismiss_request: Option<OnDismissRequest>,
children: I,
) -> OverlayRequestwhere
I: IntoIterator<Item = T>,
T: IntoUiElement<H>,
Sourcepub fn use_open_model<H: UiHost>(
&self,
cx: &mut ElementContext<'_, H>,
) -> ControllableModel<bool>
pub fn use_open_model<H: UiHost>( &self, cx: &mut ElementContext<'_, H>, ) -> ControllableModel<bool>
Returns a Model<bool> that behaves like Radix useControllableState for open.
pub fn open_model<H: UiHost>( &self, cx: &mut ElementContext<'_, H>, ) -> Model<bool>
Sourcepub fn is_open<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> bool
pub fn is_open<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> bool
Reads the current open value from the derived open model.
pub fn modal_request<H: UiHost, I, T>(
&self,
cx: &mut ElementContext<'_, H>,
id: GlobalElementId,
trigger: GlobalElementId,
presence: OverlayPresence,
children: I,
) -> OverlayRequestwhere
I: IntoIterator<Item = T>,
T: IntoUiElement<H>,
Trait Implementations§
Source§impl Clone for DialogRoot
impl Clone for DialogRoot
Source§fn clone(&self) -> DialogRoot
fn clone(&self) -> DialogRoot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DialogRoot
impl Debug for DialogRoot
Source§impl Default for DialogRoot
impl Default for DialogRoot
Source§fn default() -> DialogRoot
fn default() -> DialogRoot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DialogRoot
impl !RefUnwindSafe for DialogRoot
impl !Send for DialogRoot
impl !Sync for DialogRoot
impl Unpin for DialogRoot
impl UnsafeUnpin for DialogRoot
impl !UnwindSafe for DialogRoot
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