pub struct Scaffold { /* private fields */ }Expand description
Arranges the top app bar, leading rail, content and bottom bar. The floating action and snackbar are anchored within the content region above bottom navigation. Give the scaffold a bounded size and give its content a scroll viewport if needed.
Implementations§
Source§impl Scaffold
impl Scaffold
Sourcepub fn new(id: impl Into<ElementId>, content: impl IntoElement) -> Scaffold
pub fn new(id: impl Into<ElementId>, content: impl IntoElement) -> Scaffold
Creates a scaffold with the given element ID and primary body content.
Sourcepub fn with_layout<E>(
id: impl Into<ElementId>,
content: impl FnOnce(ScaffoldContentLayout, &mut Window, &mut App) -> E + 'static,
) -> Scaffoldwhere
E: IntoElement,
pub fn with_layout<E>(
id: impl Into<ElementId>,
content: impl FnOnce(ScaffoldContentLayout, &mut Window, &mut App) -> E + 'static,
) -> Scaffoldwhere
E: IntoElement,
Builds the body with its current layout. Apply layout.padding once;
the scaffold has already allocated layout.occupied.
Sourcepub fn app_bar(self, element: impl IntoElement) -> Scaffold
pub fn app_bar(self, element: impl IntoElement) -> Scaffold
Places a top app bar above the content region.
Sourcepub fn rail(self, element: impl IntoElement) -> Scaffold
pub fn rail(self, element: impl IntoElement) -> Scaffold
Places a leading navigation rail or drawer at the logical start of the scaffold.
Sourcepub fn bottom_bar(self, element: impl IntoElement) -> Scaffold
pub fn bottom_bar(self, element: impl IntoElement) -> Scaffold
Places a bottom navigation bar or bottom app bar beneath the content region.
Sourcepub fn bottom_sheet(self, sheet: Sheet) -> Scaffold
pub fn bottom_sheet(self, sheet: Sheet) -> Scaffold
Places a Standard bottom sheet beneath the measured content column.
Sourcepub fn fab(self, element: impl IntoElement) -> Scaffold
pub fn fab(self, element: impl IntoElement) -> Scaffold
Anchors a floating action button within the scaffold according to Self::fab_position.
Sourcepub fn snackbar(self, element: impl IntoElement) -> Scaffold
pub fn snackbar(self, element: impl IntoElement) -> Scaffold
Mounts a snackbar host anchored above bottom navigation and the floating action button.
Sourcepub fn fab_position(self, position: ScaffoldFabPosition) -> Scaffold
pub fn fab_position(self, position: ScaffoldFabPosition) -> Scaffold
Sets the horizontal and overlay placement of the floating action button (default ScaffoldFabPosition::End).
Sourcepub fn content_insets(self, insets: ScaffoldInsets) -> Scaffold
pub fn content_insets(self, insets: ScaffoldInsets) -> Scaffold
Sets minimum distances from the scaffold’s edges to usable content. Space occupied by bars and the rail counts toward those distances.
Trait Implementations§
Source§impl IntoElement for Scaffold
impl IntoElement for Scaffold
Source§type Element = ViewElement<Scaffold>
type Element = ViewElement<Scaffold>
Source§fn into_element(self) -> <Scaffold as IntoElement>::Element
fn into_element(self) -> <Scaffold as IntoElement>::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for Scaffold
impl RenderOnce for Scaffold
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 Scaffold
impl !Send for Scaffold
impl !Sync for Scaffold
impl !UnwindSafe for Scaffold
impl Forget for Scaffold
impl Freeze for Scaffold
impl Move for Scaffold
impl Unpin for Scaffold
impl UnsafeUnpin for Scaffold
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.