Tabs
ラベル付きパネルを切り替え、キーボードによる自動または手動のアクティブ化に対応します。
デモを読み込み中…
let tabs = Tabs::new("settings", "general");
tabs.root().flex_col().child(tabs.list().flex_row())#インポート
quickgui から Tabs をインポートします。
use quickgui::*;#使い方
let tabs = Tabs::new("settings", "general");
tabs.root().flex_col().child(tabs.list().flex_row())#構成
Tabs::rootTabs::listTabs::tabTabs::indicatorTabs::panel
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Tabs
ソースを見るpub fn new(root_id: impl Into<ElementId>, active: impl Into<ElementId>) -> Selfwithout_selectionpub fn without_selection(root_id: impl Into<ElementId>) -> Self—
Configures without selection for this part.
pub fn without_selection(root_id: impl Into<ElementId>) -> Selfソースを見るfrom_statepub fn from_state(root_id: impl Into<ElementId>, state: &TabsState) -> Self—
Configures from state for this part.
pub fn from_state(root_id: impl Into<ElementId>, state: &TabsState) -> Selfソースを見るorientationpub const fn orientation(mut self, orientation: TabsOrientation) -> Self—
Configures orientation for this part.
pub const fn orientation(mut self, orientation: TabsOrientation) -> Selfソースを見るverticalpub const fn vertical(self) -> Self—
activate_on_focuspub const fn activate_on_focus(mut self, activate_on_focus: bool) -> Self—
Activate an enabled tab as arrow/Home/End navigation moves focus to it. The default is manual activation: arrows move focus and Enter or Space invokes the tab's ordinary click listener.
pub const fn activate_on_focus(mut self, activate_on_focus: bool) -> 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ソースを見るkeep_mountedpub const fn keep_mounted(mut self, keep_mounted: bool) -> Self—
Retain inactive panels as `display: none` instead of omitting them from the mounted tree.
pub const fn keep_mounted(mut self, keep_mounted: bool) -> Selfソースを見るroot_idpub const fn root_id(self) -> ElementId—
list_idpub fn list_id(self) -> ElementId—
active_valuepub const fn active_value(self) -> Option<ElementId>—
activates_on_focuspub const fn activates_on_focus(self) -> bool—
loops_focuspub const fn loops_focus(self) -> bool—
keeps_panels_mountedpub const fn keeps_panels_mounted(self) -> bool—
activation_movementpub const fn activation_movement(mut self, movement: TabsActivationMovement) -> Self—
Declare which way the selection travelled, for a descriptor built without a [`TabsState`].
pub const fn activation_movement(mut self, movement: TabsActivationMovement) -> Selfソースを見るactivation_directionpub const fn activation_direction(self) -> TabsActivationDirection—
The side the selection last travelled toward, Base UI's `data-activation-direction`. A horizontal tab list reports `Left` or `Right`, a vertical one `Up` or `Down`, and both report `None` until the application selects through [`TabsState::select_at`].
pub const fn activation_direction(self) -> TabsActivationDirectionソースを見るindicator_geometrypub fn indicator_geometry( self, handle: &crate::AnchorPlacementHandle, ) -> Option<TabsIndicatorGeometry>—
Read back the active tab's laid-out geometry from a bound indicator handle. Mount the indicator with [`Tab::tracked_indicator_with`] and pass the same handle here on the next frame. The rectangle is the active tab's own, in window logical coordinates, and is `None` until the indicator has been painted once.
pub fn indicator_geometry( self, handle: &crate::AnchorPlacementHandle, ) -> Option<TabsIndicatorGeometry>ソースを見るtabpub fn tab(self, value: impl Into<ElementId>) -> Tab—
Tabs::root_with
ソースを見るpub fn root_with(self, root: Element) -> ElementDecorate an application-owned structural root without adding role or appearance.
Tabs::root
ソースを見るpub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Tabs::list_with
ソースを見るpub fn list_with(self, list: Element) -> ElementDecorate an application-owned tab-list root.
Tabs::list
ソースを見るpub fn list(self) -> ElementCreate the unstyled list part. Use [`Self::list_with`] to supply an existing element.
