Toggle
オン/オフの押下状態を保持する、押下可能なコントロールです。
デモを読み込み中…
Toggle::new(pressed)
.root().on_click(toggle).child("Pin this item")#インポート
quickgui から Toggle をインポートします。
use quickgui::*;#使い方
Toggle::new(pressed)
.root().on_click(toggle).child("Pin this item")#構成
Toggle::rootToggle::indicator
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Toggle
ソースを見るpub const fn new(pressed: bool) -> Selfis_pressedpub const fn is_pressed(self) -> bool—
Toggle::root_with
ソースを見るpub fn root_with(self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Toggle::root
ソースを見るpub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Toggle::indicator_with
ソースを見るpub fn indicator_with(self, indicator: Element) -> ElementHide an application-owned decorative indicator from the accessible name.
Toggle::indicator
ソースを見るpub fn indicator(self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
toggle
ソースを見るpub fn toggle(pressed: bool) -> ElementCreate an unstyled controlled toggle-button root. This shorthand is equivalent to `Toggle::new(pressed).root_with(div())`.
