Skip to main content

NavProps

Struct NavProps 

Source
pub struct NavProps {
    pub documents: Option<DocumentTabsConfig>,
    pub title: String,
    pub presentation: NavPresentation,
    pub adaptive: bool,
    pub sidebar_toggle: bool,
    pub search: Option<SearchProps>,
    pub list_width: Option<f64>,
    pub list_visible: bool,
}
Expand description

Navigation host (docs/navigation.md).

Fields§

§documents: Option<DocumentTabsConfig>

Document-tab chrome, independent of navigation destinations.

§title: String§presentation: NavPresentation

The presentation to draw now; re-presented in place by NavPatch::Presentation.

§adaptive: bool

The app left the presentation automatic (NavStyle::Automatic, or a Sidebar nav host with no .presentation(…) pin), so it is free to follow the window.

Only a toolkit answering Cap::NavRepresent = Emulated needs this: its own adaptive container owns the morph, and it must know whether the app asked for one at all before building it. With two presentations that bit could be inferred from a lowered Split; with four it cannot, so it is carried explicitly rather than encoded.

Native re-presenters ignore it (they are told each presentation as it is resolved), and so do toolkits that cannot re-present.

§sidebar_toggle: bool

Draw the platform’s own show/hide-sidebar affordance on this host’s chrome (docs/toolbars.md). true for every nav(Sidebar) unless the app opted out: the toolkit owns both the button and the behavior (NSToolbarToggleSidebarItemIdentifier, the split view’s collapse on GTK, NavigationView.IsPaneOpen on XAML), so an app that once declared the item by hand now declares nothing. Hosts with no sidebar ignore it.

§search: Option<SearchProps>

Search over this navigation surface (Nav::searchable, docs/search.md). None = the surface is not searchable and no field is rendered anywhere.

§list_width: Option<f64>

Some(width) = this host has a content-list pane (Pane::List) at this preferred width in points, between the sidebar and the detail (docs/navigation.md). Read at realize, because a backend that builds a different container for a three-pane host (UIKit’s triple-column style is init-only) needs to know before it builds. None on every host without one, including all of them on backends answering crate::Cap::NavContentList Unsupported: the pieces layer composes there and the prop is never set.

§list_visible: bool

Whether that pane is showing for the destination the host opens on (Nav::content_list_for). Read at realize, like list_width, and for a related reason: a backend whose pane is a real split item can only honor a collapsed state reliably by setting it before the item joins the split. Told afterwards (by NavPatch::ListVisible, on a window that has not been displayed yet), AppKit reports the item collapsed and then lays it back out from its holding priorities, and the app opens with a list beside a page that does not own one. true on every host whose first destination has a list, and on hosts with no pane at all, where it means nothing.

Trait Implementations§

Source§

impl Clone for NavProps

Source§

fn clone(&self) -> NavProps

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NavProps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NavProps

Source§

fn default() -> NavProps

Returns the “default value” for a type. Read more
Source§

impl PartialEq for NavProps

Source§

fn eq(&self, other: &NavProps) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NavProps

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Day API ↩ Guides· daybrite.dev