pub struct MaterialSideSheet { /* private fields */ }Expand description
An M3 side sheet. By default it is a nonmodal standard sheet docked to
its parent’s trailing edge that leaves the main content interactive;
MaterialSideSheet::modal presents it over the window instead, and
MaterialSideSheet::specimen renders it in place. Its controlled
visibility retargets the spatial spring, including on close.
Implementations§
Source§impl MaterialSideSheet
impl MaterialSideSheet
pub fn new(id: impl Into<ElementId>) -> Self
pub fn open(self, open: bool) -> Self
pub fn width(self, width: Rems) -> Self
Sourcepub fn modal(self, modal: bool) -> Self
pub fn modal(self, modal: bool) -> Self
Present over the window with a scrim; Escape, the scrim and the close button dismiss it.
Sourcepub fn specimen(self, specimen: bool) -> Self
pub fn specimen(self, specimen: bool) -> Self
Render the sheet’s surface in place, without motion (a specimen).
Sourcepub fn edge(self, edge: SideSheetEdge) -> Self
pub fn edge(self, edge: SideSheetEdge) -> Self
The edge the sheet docks to (default the trailing edge).
Sourcepub fn contained(self, contained: bool) -> Self
pub fn contained(self, contained: bool) -> Self
Present the modal sheet over its positioned parent’s bounds instead of the whole window.
Sourcepub fn dismiss_on_scrim(self, dismiss: bool) -> Self
pub fn dismiss_on_scrim(self, dismiss: bool) -> Self
Whether pressing the modal sheet’s scrim dismisses it (default true).
Sourcepub fn dismiss_on_escape(self, dismiss: bool) -> Self
pub fn dismiss_on_escape(self, dismiss: bool) -> Self
Whether Escape dismisses the modal sheet (default true).
Sourcepub fn headline(self, headline: impl Into<SharedString>) -> Self
pub fn headline(self, headline: impl Into<SharedString>) -> Self
The title-large headline in the header.
Sourcepub fn label(self, label: impl Into<SharedString>) -> Self
pub fn label(self, label: impl Into<SharedString>) -> Self
The modal sheet’s accessible name when it differs from (or there is no) headline.
Sourcepub fn back(
self,
label: impl Into<SharedString>,
on_back: impl Fn(&mut Window, &mut App) + 'static,
) -> Self
pub fn back( self, label: impl Into<SharedString>, on_back: impl Fn(&mut Window, &mut App) + 'static, ) -> Self
A leading back button named label.
A trailing close button named label; it calls on_dismiss.
Sourcepub fn action(self, action: impl IntoElement) -> Self
pub fn action(self, action: impl IntoElement) -> Self
An action under the divider at the sheet’s bottom, in call order.
pub fn on_dismiss(self, f: impl Fn(&mut Window, &mut App) + 'static) -> Self
Trait Implementations§
Source§impl IntoElement for MaterialSideSheet
impl IntoElement for MaterialSideSheet
Source§type Element = ViewElement<MaterialSideSheet>
type Element = ViewElement<MaterialSideSheet>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element].Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement].Source§impl ParentElement for MaterialSideSheet
impl ParentElement for MaterialSideSheet
Source§fn extend(&mut self, children: impl IntoIterator<Item = AnyElement>)
fn extend(&mut self, children: impl IntoIterator<Item = AnyElement>)
§fn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
fn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
§fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for MaterialSideSheet
impl !Send for MaterialSideSheet
impl !Sync for MaterialSideSheet
impl !UnwindSafe for MaterialSideSheet
impl Freeze for MaterialSideSheet
impl Unpin for MaterialSideSheet
impl UnsafeUnpin for MaterialSideSheet
Blanket Implementations§
§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>where
Self: Sized,
T: SpringTarget,
<T as SpringTarget>::Output: 'static,
fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>where
Self: Sized,
T: SpringTarget,
<T as SpringTarget>::Output: 'static,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
§impl<T> ElementExt for Twhere
T: ParentElement,
impl<T> ElementExt for Twhere
T: ParentElement,
§fn text_selection_scope(self, scope: TextSelectionScopeId) -> impl IntoElementwhere
Self: IntoElement,
fn text_selection_scope(self, scope: TextSelectionScopeId) -> impl IntoElementwhere
Self: IntoElement,
§fn on_prepaint<F>(self, callback: F) -> Selfwhere
F: FnOnce(Bounds<Pixels>, &mut Window, &mut App) + 'static,
fn on_prepaint<F>(self, callback: F) -> Selfwhere
F: FnOnce(Bounds<Pixels>, &mut Window, &mut App) + 'static,
callback during prepaint with this element’s resolved bounds.§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<E> TestTextExt for Ewhere
E: IntoElement,
impl<E> TestTextExt for Ewhere
E: IntoElement,
§fn test_text(self, text: impl Into<SharedString>) -> Self::Element
fn test_text(self, text: impl Into<SharedString>) -> Self::Element
test-support, records text each time the element paints.
Otherwise returns the element it builds.§fn test_alt_text(self, text: impl Into<SharedString>) -> Self::Element
fn test_alt_text(self, text: impl Into<SharedString>) -> Self::Element
Self::test_text] for an image’s alternative text, which
stands in for what the element draws.