本文へスキップ

Menubar

ウィンドウ内の水平メニューバーとその項目を管理します。

デモを読み込み中…

#インポート

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

use quickgui::*;

#使い方

let bar = Menubar::new("app");
bar.root().flex_row()

#構成

  • Menubar::root
  • Menubar::item

#API リファレンス

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

pub fn new(root_id: impl Into<ElementId>) -> Self
root_idpub const fn root_id(self) -> ElementId—

Configures root id for this part.

pub const fn root_id(self) -> ElementId
ソースを見る
item_idpub fn item_id(self, index: usize) -> ElementId—

Configures item id for this part.

pub fn item_id(self, index: usize) -> ElementId
ソースを見る
itempub const fn item(self, state: MenubarState, index: usize) -> Option<MenubarItem>—

Describe one top-level menu trigger. Indices at or past [`MenubarState::menu_count`] return `None`, so a caller-driven loop stays bounded by the state instead of by its own arithmetic.

pub const fn item(self, state: MenubarState, index: usize) -> Option<MenubarItem>
ソースを見る

Menubar::root_with

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

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

Menubar::root

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

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