pub enum NavPresentation {
Split,
Stack,
Tabs,
Rail,
}Expand description
How a navigation host lays its panes out (docs/navigation.md).
This is the resolved presentation, what the toolkit must draw right now. The app asks for
one through Nav::presentation, where leaving it unset means “automatic”: the pieces
layer resolves it from the window’s SizeClass and the toolkit’s Cap::NavSplit, and
re-resolves it whenever the class changes. There is no Auto variant here because a
backend can only ever draw a concrete one, so the undecided state stays on the app’s side
of the boundary where it can still be decided.
Variants§
Split
Sidebar beside detail, both visible (NSSplitViewController, nested GtkPaneds,
a NavigationView). The sidebar pane gets its own container.
Stack
One page at a time, back-navigable. The sidebar pane becomes the stack’s root.
Tabs
The rows drawn as a tab bar, one page’s content beside it, no back stack: what a
phone-shaped window wants from a one-of-N surface (UITabBarController, a Material
NavigationBarView, NavigationView.PaneDisplayMode = Top). The Pane::Sidebar page
is not drawn at all: its rows are the chrome.
Rail
The rows drawn as a narrow icon strip beside the content, the Medium-width answer
between Self::Tabs and Self::Split (a Material NavigationRailView,
PaneDisplayMode = LeftCompact, an ArkUI vertical Tabs).
A backend with no rail rounds it to a neighbor of its own choosing rather than
failing: UIKit answers Tabs (which is what iPadOS does at that width), GTK the same.
Rounding is expected and correct; this variant is a request, not a contract.
Implementations§
Sourcepub fn is_split(self) -> bool
pub fn is_split(self) -> bool
true for NavPresentation::Split, the shape most backend code wants.
Sourcepub fn rows_are_chrome(self) -> bool
pub fn rows_are_chrome(self) -> bool
true when the rows are the chrome rather than a drawn page: Self::Tabs and
Self::Rail. Both hide the Pane::Sidebar page and render its rows themselves, so
backend code that only cares about that distinction asks this instead of matching both.
Trait Implementations§
Source§fn clone(&self) -> NavPresentation
fn clone(&self) -> NavPresentation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more