Toolbar
1 つのロービングフォーカスモデルの下に操作と入力をまとめます。
デモを読み込み中…
let bar = Toolbar::new("main", &state, &items);
bar.root().flex_row().gap(8.0)#インポート
quickgui から Toolbar をインポートします。
use quickgui::*;#使い方
let bar = Toolbar::new("main", &state, &items);
bar.root().flex_row().gap(8.0)#構成
Toolbar::rootToolbar::itemToolbar::buttonToolbar::linkToolbar::inputToolbar::groupToolbar::separator
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Toolbar
ソースを見るpub fn new( root_id: impl Into<ElementId>, state: &ToolbarState, items: &'a [ToolbarItem], ) -> SelfCreate a toolbar over the caller's ordered items. # Panics Panics with more than [`MAX_TOOLBAR_ITEMS`] items or duplicate item values.
orientationpub const fn orientation(mut self, orientation: ToolbarOrientation) -> Self—
Configures orientation for this part.
pub const fn orientation(mut self, orientation: ToolbarOrientation) -> Selfソースを見るverticalpub const fn vertical(self) -> Self—
loop_focuspub const fn loop_focus(mut self, loop_focus: bool) -> Self—
Wrap from the last item 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—
itemspub const fn items(self) -> &'a [ToolbarItem]—
axispub const fn axis(self) -> ToolbarOrientation—
item_idpub fn item_id(self, value: impl Into<ElementId>) -> ElementId—
Configures item id for this part.
pub fn item_id(self, value: impl Into<ElementId>) -> ElementIdソースを見るroving_valuepub fn roving_value(self) -> Option<ElementId>—
The item that currently owns the toolbar's single Tab stop. This is the controlled active 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>ソースを見るitempub fn item(self, value: impl Into<ElementId>) -> Option<ToolbarEntry<'a>>—
Describe one declared item.
pub fn item(self, value: impl Into<ElementId>) -> Option<ToolbarEntry<'a>>ソースを見るToolbar::root_with
ソースを見るpub fn root_with(self, root: Element) -> ElementDecorate an application-owned toolbar root without adding layout or appearance.
Toolbar::root
ソースを見るpub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Toolbar::group_with
ソースを見るpub fn group_with(self, group: Element) -> ElementDecorate a caller-owned group of related toolbar items, Base UI's Toolbar.Group. The group is a labelling and structural unit only: every item inside it keeps taking part in the toolbar's single roving Tab stop, so grouping never creates a second focus scope.
Toolbar::group
ソースを見るpub fn group(self) -> ElementCreate the unstyled group part. Use [`Self::group_with`] to supply an existing element.
Toolbar::separator_with
ソースを見るpub fn separator_with(self, separator: Element) -> ElementDecorate a caller-owned divider between toolbar groups, Base UI's Toolbar.Separator. A separator carries the Separator role across the toolbar's cross axis and never takes focus, so arrow navigation steps straight past it.
Toolbar::separator
ソースを見るpub fn separator(self) -> ElementCreate the unstyled separator part. Use [`Self::separator_with`] to supply an existing element.
