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
Sourcepub fn new(
id: impl Into<ElementId>,
state: &Entity<DialogState>,
title: impl Into<SharedString>,
content: impl IntoElement,
) -> Sheet
pub fn new( id: impl Into<ElementId>, state: &Entity<DialogState>, title: impl Into<SharedString>, content: impl IntoElement, ) -> Sheet
Creates a sheet bound to a DialogState with the given accessible title and body content.
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 maximum width in logical pixels (defaults to 640 dp for bottom sheets and 400 dp for side sheets).
Sourcepub fn drag_enabled(self, enabled: bool) -> Sheet
pub fn drag_enabled(self, enabled: bool) -> Sheet
Enables or disables pointer drag resizing on a retained bottom sheet (default true).
Sourcepub fn drag_thresholds(self, thresholds: BottomSheetThresholds) -> Sheet
pub fn drag_thresholds(self, thresholds: BottomSheetThresholds) -> Sheet
Sets the distance and velocity thresholds used when settling a released drag.
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.
Sourcepub fn edge(self, edge: SheetEdge) -> Sheet
pub fn edge(self, edge: SheetEdge) -> Sheet
Sets which edge the sheet attaches to (default SheetEdge::Bottom). Ignored for retained bottom sheets.
Sourcepub fn mode(self, mode: SheetMode) -> Sheet
pub fn mode(self, mode: SheetMode) -> Sheet
Sets whether the sheet is standard (docked) or modal (default SheetMode::Standard).
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.
Sourcepub fn placement(self, placement: SheetPlacement) -> Sheet
pub fn placement(self, placement: SheetPlacement) -> Sheet
Sets whether a side sheet is docked to the edge or detached with margins (default SheetPlacement::Docked).
Sourcepub fn margins(self, margins: SheetMargins) -> Sheet
pub fn margins(self, margins: SheetMargins) -> Sheet
Sets the logical inset margins used when SheetPlacement::Detached is active.
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 show_header(self, show: bool) -> Sheet
pub fn show_header(self, show: bool) -> Sheet
Shows or hides the visible header row while keeping the constructor’s name as the accessible label.
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.
Sourcepub fn back_content(self, back: impl IntoElement) -> Sheet
pub fn back_content(self, back: impl IntoElement) -> Sheet
Replaces the leading back button with custom content.
Sourcepub fn close_label(self, label: impl Into<SharedString>) -> Sheet
pub fn close_label(self, label: impl Into<SharedString>) -> Sheet
Overrides the accessible label of the default close button (default "Close").
Sourcepub fn show_close(self, show: bool) -> Sheet
pub fn show_close(self, show: bool) -> Sheet
Shows or hides the default close button in the sheet header (default true).
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.
Adds a fixed footer slot at the bottom of the sheet.
Shows or hides a horizontal divider above the sheet footer (default false).
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.
Sourcepub fn properties(self, properties: DialogProperties) -> Sheet
pub fn properties(self, properties: DialogProperties) -> Sheet
Configures Escape and outside-click dismissal behavior for modal sheets.
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.
Sourcepub fn shape(self, shape: CornerShape) -> Sheet
pub fn shape(self, shape: CornerShape) -> Sheet
Overrides the corner shape of the sheet container.
Sourcepub fn container_role(self, role: ColorRole) -> Sheet
pub fn container_role(self, role: ColorRole) -> Sheet
Overrides the theme ColorRole used for the sheet container background.
Sourcepub fn content_role(self, role: ColorRole) -> Sheet
pub fn content_role(self, role: ColorRole) -> Sheet
Overrides the theme ColorRole used for the sheet foreground content.
Sourcepub fn colors(self, colors: SheetColors) -> Sheet
pub fn colors(self, colors: SheetColors) -> Sheet
Overrides the sheet’s container, content, header, divider, and scrim colors.
Sourcepub fn tonal_elevation(self, elevation: Elevation) -> Sheet
pub fn tonal_elevation(self, elevation: Elevation) -> Sheet
Sets the tonal elevation applied to the sheet surface.
Sourcepub fn shadow_elevation(self, elevation: Elevation) -> Sheet
pub fn shadow_elevation(self, elevation: Elevation) -> Sheet
Overrides the shadow elevation cast by the sheet surface.
Sourcepub fn scrim_opacity(self, opacity: f32) -> Sheet
pub fn scrim_opacity(self, opacity: f32) -> Sheet
Sets the modal backdrop scrim opacity, clamped to 0–1. NaN falls back to the default (0.32).
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> MaterialElementExt for Twhere
T: IntoElement,
impl<T> MaterialElementExt for Twhere
T: IntoElement,
Source§fn badge_label(self, text: impl Into<SharedString>) -> Badge
fn badge_label(self, text: impl Into<SharedString>) -> Badge
Badge to this element’s upper trailing edge.Source§fn badge_count(self, count: usize, maximum: usize) -> Badge
fn badge_count(self, count: usize, maximum: usize) -> Badge
Badge to this element’s upper trailing edge.Source§fn tooltip(
self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Tooltip
fn tooltip( self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Tooltip
Tooltip.Menu.Menu
whose items are built lazily only while the menu is open.Source§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.