pub enum NavStyle {
Automatic,
Tabs,
Sidebar,
}Expand description
How a nav presents its one-of-N choice (docs/navigation.md).
The default is Self::Automatic: unless you say otherwise, a nav wears whatever the
platform wears at the window’s current width, and changes as the window does.
Variants§
Automatic
The default. The platform’s own answer at this size: a tab bar on a phone-shaped window, a rail in the middle, a sidebar beside the detail when there is room, and it re-presents live as the window crosses a breakpoint (docs/size-classes.md).
This is .tabViewStyle(.sidebarAdaptable)’s job, and the native containers it maps to
are the ones the platforms built for it: UITabBarController in .tabSidebar mode, a
NavigationView driving its own PaneDisplayMode, a Material navigation bar / rail /
drawer. A toolkit that cannot draw a tab bar (Cap::NavTabs) degrades to Self::Sidebar
rather than to a hole.
Tabs
Pinned: a tab bar at every size, however wide the window gets. Reach for it when the content is peer sections that should never become a sidebar.
Sidebar
Pinned: a NavigationSplitView, a sidebar list + a detail. Wide windows show both panes
(on GTK an AdwNavigationSplitView); narrow ones collapse to a list that pushes the
detail, which is the one shape Self::Automatic never produces on its own.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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