pub struct Modal<C> { /* private fields */ }Expand description
Modal container widget.
Invariants:
content_rect()is always clamped within the givenarea.- Size constraints are applied before positioning and never exceed
area.
Failure modes:
- If the available
areais empty or constraints clamp to zero size, the content is not rendered. close_on_backdroprequireshit_idto be set; otherwise backdrop clicks cannot be distinguished from content clicks.
Implementations§
Source§impl<C> Modal<C>
impl<C> Modal<C>
Sourcepub fn config(self, config: ModalConfig) -> Self
pub fn config(self, config: ModalConfig) -> Self
Set modal configuration.
Sourcepub fn position(self, position: ModalPosition) -> Self
pub fn position(self, position: ModalPosition) -> Self
Set modal position.
Sourcepub fn backdrop(self, backdrop: BackdropConfig) -> Self
pub fn backdrop(self, backdrop: BackdropConfig) -> Self
Set backdrop configuration.
Sourcepub fn size(self, size: ModalSizeConstraints) -> Self
pub fn size(self, size: ModalSizeConstraints) -> Self
Set size constraints.
Sourcepub fn close_on_backdrop(self, close: bool) -> Self
pub fn close_on_backdrop(self, close: bool) -> Self
Set close-on-backdrop behavior.
Sourcepub fn close_on_escape(self, close: bool) -> Self
pub fn close_on_escape(self, close: bool) -> Self
Set close-on-escape behavior.
Sourcepub fn content_rect(&self, area: Rect) -> Rect
pub fn content_rect(&self, area: Rect) -> Rect
Compute the content rectangle for the given area.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Modal<C>where
C: Freeze,
impl<C> RefUnwindSafe for Modal<C>where
C: RefUnwindSafe,
impl<C> Send for Modal<C>where
C: Send,
impl<C> Sync for Modal<C>where
C: Sync,
impl<C> Unpin for Modal<C>where
C: Unpin,
impl<C> UnwindSafe for Modal<C>where
C: UnwindSafe,
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