pub struct Sheet { /* private fields */ }Expand description
A docked or modal Material sheet. Standard sheets take part in parent layout. The caller owns the bottom sheet’s expanded value and handles changes.
Implementations§
Source§impl Sheet
impl Sheet
pub fn new( id: impl Into<ElementId>, state: &Entity<DialogState>, title: impl Into<SharedString>, content: impl IntoElement, ) -> Sheet
Sourcepub fn bottom(
id: impl Into<ElementId>,
state: &Entity<BottomSheetState>,
title: impl Into<SharedString>,
content: impl IntoElement,
) -> Sheet
pub fn bottom( id: impl Into<ElementId>, state: &Entity<BottomSheetState>, title: impl Into<SharedString>, content: impl IntoElement, ) -> Sheet
Creates a bottom sheet with retained stops and state-owned visibility.
Sourcepub fn peek_height(self, height: Pixels) -> Sheet
pub fn peek_height(self, height: Pixels) -> Sheet
Sets the retained bottom sheet’s partial height. It fits the expanded extent.
Sourcepub fn max_width(self, width: Pixels) -> Sheet
pub fn max_width(self, width: Pixels) -> Sheet
Sets the bottom sheet’s maximum width in logical pixels.
pub fn drag_enabled(self, enabled: bool) -> Sheet
pub fn drag_thresholds(self, thresholds: BottomSheetThresholds) -> Sheet
Sourcepub fn handle_content(self, content: impl IntoElement) -> Sheet
pub fn handle_content(self, content: impl IntoElement) -> Sheet
Replaces the grip decoration of the retained sheet’s resize control.
Sourcepub fn handle_label(self, label: impl Into<SharedString>) -> Sheet
pub fn handle_label(self, label: impl Into<SharedString>) -> Sheet
Names the resize action for keyboard and assistive technology.
Sourcepub fn show_handle(self, show: bool) -> Sheet
pub fn show_handle(self, show: bool) -> Sheet
Uses a text height action in place of the grip when multiple stops are available.
Sourcepub fn content_insets(self, insets: ScaffoldInsets) -> Sheet
pub fn content_insets(self, insets: ScaffoldInsets) -> Sheet
Sets logical padding within the bottom sheet’s scrolling content.
pub fn edge(self, edge: SheetEdge) -> Sheet
pub fn mode(self, mode: SheetMode) -> Sheet
Sourcepub fn extent(self, extent: Pixels) -> Sheet
pub fn extent(self, extent: Pixels) -> Sheet
Sets expanded height for a bottom sheet, or width for a side sheet.
Sourcepub fn expandable(
self,
expanded: bool,
on_change: impl Fn(bool, &mut Window, &mut App) + 'static,
) -> Sheet
pub fn expandable( self, expanded: bool, on_change: impl Fn(bool, &mut Window, &mut App) + 'static, ) -> Sheet
Enables a keyboard-operable expand and collapse action on a bottom sheet.
pub fn placement(self, placement: SheetPlacement) -> Sheet
pub fn margins(self, margins: SheetMargins) -> Sheet
Sourcepub fn header_content(self, heading: impl IntoElement) -> Sheet
pub fn header_content(self, heading: impl IntoElement) -> Sheet
Replaces the visible heading while preserving the accessible sheet name.
Sourcepub fn back(
self,
label: impl Into<SharedString>,
on_back: impl Fn(&mut Window, &mut App) + 'static,
) -> Sheet
pub fn back( self, label: impl Into<SharedString>, on_back: impl Fn(&mut Window, &mut App) + 'static, ) -> Sheet
Adds a named back action. Navigation ownership remains with the caller.
pub fn back_content(self, back: impl IntoElement) -> Sheet
pub fn close_label(self, label: impl Into<SharedString>) -> Sheet
pub fn show_close(self, show: bool) -> Sheet
Sourcepub fn close_content<E>(
self,
close: impl FnOnce(SheetClose) -> E + 'static,
) -> Sheetwhere
E: IntoElement,
pub fn close_content<E>(
self,
close: impl FnOnce(SheetClose) -> E + 'static,
) -> Sheetwhere
E: IntoElement,
Builds a custom close control. Connect its activation to the supplied action.
Sourcepub fn edge_divider(self, visible: bool) -> Sheet
pub fn edge_divider(self, visible: bool) -> Sheet
Adds a divider between a docked Standard side sheet and its adjacent content.
pub fn properties(self, properties: DialogProperties) -> Sheet
Sourcepub fn on_dismiss_request(
self,
request: impl Fn(DialogCloseReason, &mut Window, &mut App) -> bool + 'static,
) -> Sheet
pub fn on_dismiss_request( self, request: impl Fn(DialogCloseReason, &mut Window, &mut App) -> bool + 'static, ) -> Sheet
Return false to veto a user-initiated close.
Sourcepub fn on_close(
self,
close: impl Fn(DialogCloseReason, &mut Window, &mut App) + 'static,
) -> Sheet
pub fn on_close( self, close: impl Fn(DialogCloseReason, &mut Window, &mut App) + 'static, ) -> Sheet
Receives accepted modal closes or requests to remove a Standard sheet.
pub fn shape(self, shape: CornerShape) -> Sheet
pub fn container_role(self, role: ColorRole) -> Sheet
pub fn content_role(self, role: ColorRole) -> Sheet
pub fn colors(self, colors: SheetColors) -> Sheet
pub fn tonal_elevation(self, elevation: Elevation) -> Sheet
pub fn shadow_elevation(self, elevation: Elevation) -> Sheet
pub fn scrim_opacity(self, opacity: f32) -> Sheet
Trait Implementations§
Source§impl IntoElement for Sheet
impl IntoElement for Sheet
Source§type Element = ViewElement<Sheet>
type Element = ViewElement<Sheet>
Source§fn into_element(self) -> <Sheet as IntoElement>::Element
fn into_element(self) -> <Sheet as IntoElement>::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for Sheet
impl RenderOnce for Sheet
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for Sheet
impl !Send for Sheet
impl !Sync for Sheet
impl !UnwindSafe for Sheet
impl Forget for Sheet
impl Freeze for Sheet
impl Move for Sheet
impl Unpin for Sheet
impl UnsafeUnpin for Sheet
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§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,
Source§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,
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
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> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§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,
Source§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,
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<E> TestTextExt for Ewhere
E: IntoElement,
impl<E> TestTextExt for Ewhere
E: IntoElement,
Source§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.Source§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.