pub struct NavigationView {Show 37 fields
pub key: Option<KeyRef>,
pub menu_items: Vec<NavigationViewItem>,
pub footer_menu_items: Vec<NavigationViewItem>,
pub selected_item: Option<String>,
pub selection_changed: NavigationViewSelectionChanged,
pub item_invoked: Option<NavigationViewItemEvent>,
pub content: WidgetRef,
pub pane_display_mode: NavigationViewPaneDisplayMode,
pub compact_mode_threshold_width: f64,
pub expanded_mode_threshold_width: f64,
pub compact_pane_length: f64,
pub open_pane_length: f64,
pub is_pane_open: Option<bool>,
pub pane_open_changed: Option<NavigationViewPaneOpenChanged>,
pub is_pane_visible: bool,
pub is_title_bar_auto_padding_enabled: bool,
pub is_pane_toggle_button_visible: bool,
pub is_settings_visible: bool,
pub is_back_button_visible: NavigationViewBackButtonVisible,
pub is_back_enabled: bool,
pub back_requested: Option<Listener>,
pub selection_follows_focus: NavigationViewSelectionFollowsFocus,
pub header: Option<WidgetRef>,
pub always_show_header: bool,
pub pane_title: String,
pub pane_header: Option<WidgetRef>,
pub pane_custom_content: Option<WidgetRef>,
pub auto_suggest_box: Option<WidgetRef>,
pub pane_footer: Option<WidgetRef>,
pub content_overlay: Option<WidgetRef>,
pub display_mode_changed: Option<NavigationViewDisplayModeChanged>,
pub expanding: Option<NavigationViewItemEvent>,
pub collapsed: Option<NavigationViewItemEvent>,
pub pane_opening: Option<Listener>,
pub pane_opened: Option<Listener>,
pub pane_closing: Option<SplitViewPaneClosingHandler>,
pub pane_closed: Option<Listener>,
}Expand description
A navigation shell; the owner supplies content and handles navigation events.
Fields§
§key: Option<KeyRef>Identity retained across owner rebuilds.
Main menu items and their nested children.
Footer menu items, before the built-in settings item.
selected_item: Option<String>Stable identity selected by the owner.
selection_changed: NavigationViewSelectionChangedRequests selection after ItemInvoked has been raised.
item_invoked: Option<NavigationViewItemEvent>Receives every invocation, including the already selected item.
content: WidgetRefThe page content; NavigationView does not instantiate pages itself.
pane_display_mode: NavigationViewPaneDisplayModeChooses the adaptive or explicit layout.
compact_mode_threshold_width: f64Below this positive width Auto uses Minimal.
expanded_mode_threshold_width: f64At and above this width Auto uses Expanded.
compact_pane_length: f64The width of the closed icon rail.
open_pane_length: f64The requested open pane width, clamped to the available control width.
is_pane_open: Option<bool>Optional owner override; None lets the adaptive pane maintain its openness.
pane_open_changed: Option<NavigationViewPaneOpenChanged>Requests an owner update when a controlled pane opens or closes.
is_pane_visible: boolWhether either pane is visible.
is_title_bar_auto_padding_enabled: boolIsTitleBarAutoPaddingEnabled: whether the toggle, the pane’s items and the content’s
controls keep clear of what the system covers of the view (the MediaQuery’s padding,
which a FluentPage that extends_content_into_system_bars leaves), while the pane and the
content reach the view’s edges.
Whether the menu toggle is visible in left layouts.
is_settings_visible: boolWhether the settings entry is appended to the footer.
Whether the back button is visible.
is_back_enabled: boolWhether the visible back button accepts input.
back_requested: Option<Listener>Receives back-button activation without changing the selected page.
selection_follows_focus: NavigationViewSelectionFollowsFocusWhether keyboard focus selects menu items.
header: Option<WidgetRef>Optional page header above content.
always_show_header: boolKeeps the page header visible outside Minimal mode.
pane_title: StringText next to the pane toggle, or preceding top items.
pane_header: Option<WidgetRef>Custom header in the pane.
pane_custom_content: Option<WidgetRef>Custom content between pane header and menu items.
auto_suggest_box: Option<WidgetRef>Native search content hosted in the source AutoSuggestBox presenter slot.
Custom content above footer menu items.
content_overlay: Option<WidgetRef>Content placed below the top pane, before page content.
display_mode_changed: Option<NavigationViewDisplayModeChanged>Receives adaptive display-mode changes.
expanding: Option<NavigationViewItemEvent>Fires before expanded children become visible.
collapsed: Option<NavigationViewItemEvent>Fires after collapsed children are hidden.
pane_opening: Option<Listener>Fires when the pane starts opening.
pane_opened: Option<Listener>Fires when the pane finishes opening.
pane_closing: Option<SplitViewPaneClosingHandler>Can cancel a pane closing request.
pane_closed: Option<Listener>Fires when the pane finishes closing.
Implementations§
Sourcepub const SETTINGS_ITEM_ID: &'static str = "__navigation_settings"
pub const SETTINGS_ITEM_ID: &'static str = "__navigation_settings"
Stable identity of the built-in settings item; owner item ids must not use it.
Sourcepub fn new<C>(
menu_items: Vec<NavigationViewItem>,
selected_item: Option<String>,
selection_changed: impl Fn(&mut App, NavigationViewSelectionChangedEventArgs) + 'static,
content: impl IntoWidget<C>,
) -> Self
pub fn new<C>( menu_items: Vec<NavigationViewItem>, selected_item: Option<String>, selection_changed: impl Fn(&mut App, NavigationViewSelectionChangedEventArgs) + 'static, content: impl IntoWidget<C>, ) -> Self
Creates an adaptive navigation shell with owner-managed selection and page content.
Sourcepub fn pane_display_mode(self, value: NavigationViewPaneDisplayMode) -> Self
pub fn pane_display_mode(self, value: NavigationViewPaneDisplayMode) -> Self
Sets pane_display_mode.
Sourcepub fn is_pane_visible(self, value: bool) -> Self
pub fn is_pane_visible(self, value: bool) -> Self
Sets is_pane_visible.
Sourcepub fn is_title_bar_auto_padding_enabled(self, value: bool) -> Self
pub fn is_title_bar_auto_padding_enabled(self, value: bool) -> Self
Sets IsTitleBarAutoPaddingEnabled.
Sets is_pane_toggle_button_visible.
Sourcepub fn is_settings_visible(self, value: bool) -> Self
pub fn is_settings_visible(self, value: bool) -> Self
Sets is_settings_visible.
Sets is_back_button_visible.
Sourcepub fn is_back_enabled(self, value: bool) -> Self
pub fn is_back_enabled(self, value: bool) -> Self
Sets is_back_enabled.
Sourcepub fn always_show_header(self, value: bool) -> Self
pub fn always_show_header(self, value: bool) -> Self
Sets always_show_header.
Sourcepub fn selection_follows_focus(
self,
value: NavigationViewSelectionFollowsFocus,
) -> Self
pub fn selection_follows_focus( self, value: NavigationViewSelectionFollowsFocus, ) -> Self
Sets selection_follows_focus.
Sourcepub fn compact_mode_threshold_width(self, value: f64) -> Self
pub fn compact_mode_threshold_width(self, value: f64) -> Self
Sets compact_mode_threshold_width, coercing negative values to zero like the source property.
Sourcepub fn expanded_mode_threshold_width(self, value: f64) -> Self
pub fn expanded_mode_threshold_width(self, value: f64) -> Self
Sets expanded_mode_threshold_width, coercing negative values to zero like the source property.
Sourcepub fn compact_pane_length(self, value: f64) -> Self
pub fn compact_pane_length(self, value: f64) -> Self
Sets compact_pane_length, coercing negative values to zero like the source property.
Sourcepub fn open_pane_length(self, value: f64) -> Self
pub fn open_pane_length(self, value: f64) -> Self
Sets open_pane_length, coercing negative values to zero like the source property.
Sourcepub fn header<K>(self, child: impl IntoWidget<K>) -> Self
pub fn header<K>(self, child: impl IntoWidget<K>) -> Self
Supplies the source header content slot.
Sourcepub fn pane_header<K>(self, child: impl IntoWidget<K>) -> Self
pub fn pane_header<K>(self, child: impl IntoWidget<K>) -> Self
Supplies the source pane_header content slot.
Sourcepub fn pane_custom_content<K>(self, child: impl IntoWidget<K>) -> Self
pub fn pane_custom_content<K>(self, child: impl IntoWidget<K>) -> Self
Supplies the source pane_custom_content content slot.
Supplies the source pane_footer content slot.
Sourcepub fn content_overlay<K>(self, child: impl IntoWidget<K>) -> Self
pub fn content_overlay<K>(self, child: impl IntoWidget<K>) -> Self
Supplies the source content_overlay content slot.
Sourcepub fn auto_suggest_box<K>(self, child: impl IntoWidget<K>) -> Self
pub fn auto_suggest_box<K>(self, child: impl IntoWidget<K>) -> Self
Supplies the source auto_suggest_box content slot.
Sourcepub fn pane_title(self, title: impl Into<String>) -> Self
pub fn pane_title(self, title: impl Into<String>) -> Self
Sets the pane title shown beside the toggle or before top items.
Supplies footer entries before the built-in settings item.
Sourcepub fn is_pane_open(
self,
open: bool,
changed: impl Fn(&mut App, bool) + 'static,
) -> Self
pub fn is_pane_open( self, open: bool, changed: impl Fn(&mut App, bool) + 'static, ) -> Self
Gives the owner control of pane openness while retaining adaptive change requests.
Sourcepub fn item_invoked(
self,
callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static,
) -> Self
pub fn item_invoked( self, callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static, ) -> Self
Receives the source item_invoked event.
Sourcepub fn expanding(
self,
callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static,
) -> Self
pub fn expanding( self, callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static, ) -> Self
Receives the source expanding event.
Sourcepub fn collapsed(
self,
callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static,
) -> Self
pub fn collapsed( self, callback: impl Fn(&mut App, NavigationViewItemEventArgs) + 'static, ) -> Self
Receives the source collapsed event.
Trait Implementations§
Source§type State = NavigationViewState
type State = NavigationViewState
Source§fn create_state(&self) -> Self::State
fn create_state(&self) -> Self::State
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.