本文へスキップ

ToggleGroup

ロービングフォーカスを使い、単一または複数の押下値を管理します。

デモを読み込み中…

#インポート

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

use quickgui::*;

#使い方

let group = ToggleGroup::new("align", &state, &items);
group.root().flex_row()

#構成

  • ToggleGroup::root
  • ToggleGroup::item

#API リファレンス

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

pub fn new( root_id: impl Into<ElementId>, state: &'a ToggleGroupState, items: &'a [ToggleGroupItem], ) -> Self

Create a toggle group over the caller's ordered items. # Panics Panics with more than [`MAX_TOGGLE_GROUP_ITEMS`] items or duplicate item values.

verticalpub const fn vertical(mut self) -> Self—

Configures vertical for this part.

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

Configures loop focus for this part.

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 [ToggleGroupItem]—

Configures items for this part.

pub const fn items(self) -> &'a [ToggleGroupItem]
ソースを見る
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 group's single Tab stop. The controlled active value wins, then the first pressed enabled item, then the first enabled item.

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

Describe one declared item.

pub fn item(self, value: impl Into<ElementId>) -> Option<ToggleGroupEntry<'a>>
ソースを見る

ToggleGroup::root_with

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

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

ToggleGroup::root

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

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