pub struct OverlayModalConfig {
pub geometry: OverlayGeometry,
pub corners: OverlayCorners,
pub border: OverlayBorder,
pub container: OverlayContainer,
pub elevation: OverlayElevation,
pub entrance: OverlayEntrance,
pub scrim_dismiss: bool,
pub close_button: bool,
pub handle: bool,
pub drag: bool,
pub role: OverlayRole,
}Expand description
The chrome differences between the modal families — see the module docs.
Fields§
§geometry: OverlayGeometryWhere the panel sits.
corners: OverlayCornersWhich corners round.
border: OverlayBorderWhich edges carry an outline.
container: OverlayContainerThe surfaceContainer* rung the panel fills with.
elevation: OverlayElevationThe panel’s elevation rung.
entrance: OverlayEntranceHow the panel enters.
scrim_dismiss: boolWhether a press+release outside the panel dismisses.
Whether the close affordance is shown.
handle: boolWhether the drag-handle bar is shown (and dismisses on release).
drag: boolWhether the panel can be dragged along its own edge axis to close (see
the module docs). Meaningful only for an
OverlayGeometry::Edge panel.
role: OverlayRoleThe accessibility role.
Implementations§
Source§impl OverlayModalConfig
impl OverlayModalConfig
Sourcepub fn centered(max_width: f64) -> Self
pub fn centered(max_width: f64) -> Self
The M3 dialog chrome: a centred, fully-rounded surfaceContainerHigh
panel at elevation 3, capped at max_width, fading and scaling in.
Sourcepub fn edge(side: OverlaySide) -> Self
pub fn edge(side: OverlaySide) -> Self
The M3 sheet chrome on side: a surfaceContainerLow panel at
elevation 1 pinned to that edge, rounded on the two corners facing into
the screen, sliding in.
A left/right side sheet is OVERLAY_EDGE_FRACTION of the width capped
at OVERLAY_SIDE_SHEET_MAX_WIDTH and full height; a top/bottom sheet
is content-tall and full width.
Sourcepub fn extent(self, extent: OverlayExtent, limit: OverlayLimit) -> Self
pub fn extent(self, extent: OverlayExtent, limit: OverlayLimit) -> Self
Replace the panel’s extent along its own axis (an
OverlayGeometry::Edge config only; a no-op on a centred one).
Sourcepub fn corners(self, corners: OverlayCorners) -> Self
pub fn corners(self, corners: OverlayCorners) -> Self
Set which corners round.
Sourcepub fn border(self, border: OverlayBorder) -> Self
pub fn border(self, border: OverlayBorder) -> Self
Set which edges carry an outline.
Sourcepub fn container(self, container: OverlayContainer) -> Self
pub fn container(self, container: OverlayContainer) -> Self
Set the panel’s container rung.
Sourcepub fn elevation(self, elevation: OverlayElevation) -> Self
pub fn elevation(self, elevation: OverlayElevation) -> Self
Set the panel’s elevation rung.
Sourcepub fn entrance(self, entrance: OverlayEntrance) -> Self
pub fn entrance(self, entrance: OverlayEntrance) -> Self
Set the entrance.
Sourcepub fn scrim_dismiss(self, scrim_dismiss: bool) -> Self
pub fn scrim_dismiss(self, scrim_dismiss: bool) -> Self
Enable or disable scrim-tap dismissal.
Show or hide the close affordance.
Sourcepub fn drag(self, drag: bool) -> Self
pub fn drag(self, drag: bool) -> Self
Enable or disable drag-to-close (see OverlayModalConfig::drag).
Sourcepub fn role(self, role: OverlayRole) -> Self
pub fn role(self, role: OverlayRole) -> Self
Set the accessibility role.
Trait Implementations§
Source§impl Clone for OverlayModalConfig
impl Clone for OverlayModalConfig
impl Copy for OverlayModalConfig
Source§impl Debug for OverlayModalConfig
impl Debug for OverlayModalConfig
Source§impl PartialEq for OverlayModalConfig
impl PartialEq for OverlayModalConfig
impl StructuralPartialEq for OverlayModalConfig
Auto Trait Implementations§
impl Freeze for OverlayModalConfig
impl RefUnwindSafe for OverlayModalConfig
impl Send for OverlayModalConfig
impl Sync for OverlayModalConfig
impl Unpin for OverlayModalConfig
impl UnsafeUnpin for OverlayModalConfig
impl UnwindSafe for OverlayModalConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.