本文へスキップ

NavigationMenu

方向付きアニメーション、ビューポート、ポップアップの各パーツを備えた開閉式ナビゲーションです。

デモを読み込み中…

#インポート

quickgui から NavigationMenu をインポートします。

use quickgui::*;

#使い方

let menu = NavigationMenu::new("docs", &state, &items);
menu.root().flex_row()

#構成

  • NavigationMenu::root
  • NavigationMenu::list
  • NavigationMenu::item
  • NavigationMenu::trigger
  • NavigationMenu::icon
  • NavigationMenu::content
  • NavigationMenu::link
  • NavigationMenu::portal
  • NavigationMenu::positioner
  • NavigationMenu::popup
  • NavigationMenu::viewport
  • NavigationMenu::arrow
  • NavigationMenu::backdrop

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

NavigationMenu

ソースを見る
pub fn new( root_id: impl Into<ElementId>, state: &NavigationMenuState, items: &'a [NavigationMenuItem], ) -> Self

Create a navigation menu over the caller's ordered items. # Panics Panics with more than [`MAX_NAVIGATION_MENU_ITEMS`] items or duplicate item values.

placementpub const fn placement(mut self, placement: AnchorPlacement) -> Self—

Configures placement for this part.

pub const fn placement(mut self, placement: AnchorPlacement) -> Self
ソースを見る
loop_focuspub const fn loop_focus(mut self, loop_focus: bool) -> Self—

Wrap from the last trigger to the first. The default is `true`.

pub const fn loop_focus(mut self, loop_focus: bool) -> Self
ソースを見る
root_idpub const fn root_id(self) -> ElementId—

Configures root id for this part.

pub const fn root_id(self) -> ElementId
ソースを見る
itemspub const fn items(self) -> &'a [NavigationMenuItem]—

Configures items for this part.

pub const fn items(self) -> &'a [NavigationMenuItem]
ソースを見る
axispub const fn axis(self) -> NavigationMenuOrientation—

Configures axis for this part.

pub const fn axis(self) -> NavigationMenuOrientation
ソースを見る
valuepub const fn value(self) -> Option<ElementId>—

Configures value for this part.

pub const fn value(self) -> Option<ElementId>
ソースを見る
roving_valuepub fn roving_value(self) -> Option<ElementId>—

The trigger that owns the bar's single Tab stop. This is the controlled focused value while it names an enabled mounted item, and otherwise the first enabled item, matching the composite-widget convention.

pub fn roving_value(self) -> Option<ElementId>
ソースを見る
entrypub fn entry(self, value: impl Into<ElementId>) -> Option<NavigationMenuEntry<'a>>—

Describe one declared item.

pub fn entry(self, value: impl Into<ElementId>) -> Option<NavigationMenuEntry<'a>>
ソースを見る
schedulepub fn schedule<V: 'static>(cx: &mut ViewContext<'_, V>, state: &NavigationMenuState)—

Ask for the one repaint an armed open or close deadline needs. Call this while rendering. A settled navigation menu requests nothing, so the window sleeps.

pub fn schedule<V: 'static>(cx: &mut ViewContext<'_, V>, state: &NavigationMenuState)
ソースを見る

NavigationMenu::root_with

ソースを見る
pub fn root_with(self, root: Element) -> Element

Decorate an application-owned root without adding layout or appearance.

NavigationMenu::root

ソースを見る
pub fn root(self) -> Element

Create the unstyled root part. Use [`Self::root_with`] to supply an existing element.

NavigationMenu::list_with

ソースを見る
pub fn list_with(self, list: Element) -> Element

Decorate the application-owned list of items.

NavigationMenu::list

ソースを見る
pub fn list(self) -> Element

Create the unstyled list part. Use [`Self::list_with`] to supply an existing element.

ソースを見る
pub fn link_with(self, id: impl Into<ElementId>, active: bool, link: Element) -> Element

Decorate an application-owned navigation link without adding appearance. `active` marks the link for the current destination; it projects as the native selected state rather than as a visual class.

ソースを見る
pub fn link(self, id: impl Into<ElementId>, active: bool) -> Element

Create the unstyled link part. Use [`Self::link_with`] to supply an existing element.