pub struct NavMenuProps {Show 13 fields
pub document_keys: Vec<String>,
pub items: Vec<String>,
pub icons: Vec<Option<String>>,
pub badges: Vec<Option<String>>,
pub badge_icons: Vec<Option<String>>,
pub badge_tints: Vec<Option<Color>>,
pub tints: Vec<Option<Color>>,
pub sections: Vec<Option<String>>,
pub menus: Vec<Vec<MenuItem>>,
pub movable: Vec<bool>,
pub regroup: bool,
pub sorted: Vec<bool>,
pub selected: Option<usize>,
}Expand description
Native navigation item list. items are display titles in route order;
selected highlights the active route (split presentation; None on mobile roots).
icons (parallel to items, None = no icon) are bundled image names resolved by each
backend via resource::resolve_image_file; a backend that can’t decorate its rows just
ignores them.
Fields§
§document_keys: Vec<String>Stable document identities, parallel to items; empty for ordinary navigation.
items: Vec<String>§icons: Vec<Option<String>>§badges: Vec<Option<String>>A trailing accessory per row: an unread count, a status. Rendered right-aligned and
de-emphasized, opposite the label. Parallel to items; None draws nothing.
badge_icons: Vec<Option<String>>A trailing symbol accessory per row, in the same slot as Self::badges and drawn
after it: a bundled image name resolved the way Self::icons is. This is what a
row-level status glyph rides on (a starred page’s star) where badges carries only
text. Parallel to items; None draws nothing.
badge_tints: Vec<Option<Color>>The tint for Self::badge_icons, parallel to items. None leaves the glyph at
the backend’s neutral template tint; a status glyph that means something (a yellow
star) names its own color here, exactly as Self::tints does for the leading icon.
tints: Vec<Option<Color>>A per-row icon tint (docs/vectors.md): the row’s glyph recolored to this instead of
the backend’s neutral template tint. Parallel to items; None keeps the default.
sections: Vec<Option<String>>A section header introducing the row at the same index. Some opens a new group
before that row; None continues the current one. Parallel to items, so adding a
header never shifts the selection indices the rows are addressed by.
A per-row context menu (docs/menus.md): shown on secondary-click / long-press on
that row, the same crate::MenuItem model as everywhere else: items carry
registered action ids, so a chosen entry dispatches crate::Event::MenuAction
exactly like a piece context menu. Parallel to items; empty = no menu.
movable: Vec<bool>Which rows drag to reorder (docs/navigation.md “Reordering sidebar destinations”),
parallel to items; empty when the sidebar does not reorder. A row moves only
within the run of movable rows around it, which a section header or a fixed row
ends. A toolkit whose Cap::NavReorder is Native drags the rows in its own
sidebar and reports a drop as crate::Event::ListReorder in item indices: from
is the moved row, to the row whose position it takes, in the order before the move.
regroup: boolThe sidebar regroups (docs/navigation.md “Moving rows between sections”): a movable
row may also cross section headers, into any section whose rows are all movable. A
toolkit whose Cap::NavReorder is Native offers those drops too and reports every
drop as crate::Event::NavRegroup instead of crate::Event::ListReorder. false
keeps Self::movable’s run rule.
sorted: Vec<bool>Which movable rows keep the app’s sorted order within their own section, parallel to
items; empty when the sidebar does not regroup. Under Self::regroup, a sorted
row drops only into another section: no gap in its own section is offered.
selected: Option<usize>