pub struct NavigationViewItem {Show 13 fields
pub id: String,
pub kind: NavigationViewItemKind,
pub content: WidgetRef,
pub has_content: bool,
pub text: Option<String>,
pub icon: Option<WidgetRef>,
pub menu_items: Vec<NavigationViewItem>,
pub selects_on_invoked: bool,
pub is_enabled: bool,
pub is_visible: bool,
pub info_badge: Option<WidgetRef>,
pub has_unrealized_children: bool,
pub tool_tip: Option<ToolTip>,
}Expand description
Stable item data; the parent owns selection, expansion and focus across reparenting.
Fields§
§id: StringIdentity that remains unchanged when an item moves or enters a flyout.
kind: NavigationViewItemKindThe source container class to present.
content: WidgetRefThe content widget shown beside the icon.
has_content: boolWhether Content is non-null; false selects the icon-only template state.
text: Option<String>Original string content used for the suggested compact tooltip.
icon: Option<WidgetRef>Optional icon shown in the presenter’s icon column.
Eager child descriptors in their source order.
selects_on_invoked: boolWhether invocation changes selection as well as raising ItemInvoked.
is_enabled: boolWhether pointer and keyboard input are accepted.
is_visible: boolWhether the item participates in layout and navigation.
info_badge: Option<WidgetRef>Content for the template’s InfoBadgePresenter.
has_unrealized_children: boolAllows the Expanding callback to populate children on demand.
tool_tip: Option<ToolTip>Explicit tooltip content overriding the suggested string label.
Implementations§
Sourcepub fn new<K>(id: impl Into<String>, content: impl IntoWidget<K>) -> Self
pub fn new<K>(id: impl Into<String>, content: impl IntoWidget<K>) -> Self
Creates an entry with a stable identity and arbitrary content.
Sourcepub fn without_content(self) -> Self
pub fn without_content(self) -> Self
Clears Content while preserving a stable descriptor identity.
Sourcepub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
Creates string content and retains its suggested tooltip.
Sourcepub fn header(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn header(id: impl Into<String>, text: impl Into<String>) -> Self
Creates a noninteractive section heading.
Sourcepub fn icon<K>(self, icon: impl IntoWidget<K>) -> Self
pub fn icon<K>(self, icon: impl IntoWidget<K>) -> Self
Sets the icon column’s content.
Sets the ordered child collection.
Sourcepub fn selects_on_invoked(self, value: bool) -> Self
pub fn selects_on_invoked(self, value: bool) -> Self
Sets whether invocation also changes selection.
Sourcepub fn is_enabled(self, value: bool) -> Self
pub fn is_enabled(self, value: bool) -> Self
Sets whether the item accepts input.
Sourcepub fn is_visible(self, value: bool) -> Self
pub fn is_visible(self, value: bool) -> Self
Sets whether the item participates in layout.
Sourcepub fn info_badge<K>(self, badge: impl IntoWidget<K>) -> Self
pub fn info_badge<K>(self, badge: impl IntoWidget<K>) -> Self
Sets the badge presenter content.
Sourcepub fn tool_tip(self, tool_tip: ToolTip) -> Self
pub fn tool_tip(self, tool_tip: ToolTip) -> Self
Overrides the automatic suggested tooltip for this item.
Sourcepub fn has_unrealized_children(self, value: bool) -> Self
pub fn has_unrealized_children(self, value: bool) -> Self
Enables expansion before children have been supplied.