pub struct Tabs { /* private fields */ }Expand description
A controlled, unstyled in-window tab-set descriptor.
The application owns the active value, all content, layout, typography, colors, indicator geometry, and motion. QuickGUI supplies stable part identities, one roving Tab stop, bounded arrow/Home/End navigation, optional activation on arrow focus, disabled-item skipping, exact tab/list/panel accessibility semantics, and optional hidden panel retention.
Manual activation and looping focus match Base UI’s defaults. This descriptor retains no item registry, allocation, task, timer, observer, animation, or idle scheduler source.
Implementations§
Source§impl Tabs
impl Tabs
pub fn new(root_id: impl Into<ElementId>, active: impl Into<ElementId>) -> Self
pub fn without_selection(root_id: impl Into<ElementId>) -> Self
pub fn from_state(root_id: impl Into<ElementId>, state: &TabsState) -> Self
pub const fn orientation(self, orientation: TabsOrientation) -> Self
pub const fn vertical(self) -> Self
Sourcepub const fn activate_on_focus(self, activate_on_focus: bool) -> Self
pub const fn activate_on_focus(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 loop_focus(self, loop_focus: bool) -> Self
Sourcepub const fn keep_mounted(self, keep_mounted: bool) -> Self
pub const fn keep_mounted(self, keep_mounted: bool) -> Self
Retain inactive panels as display: none instead of omitting them from the mounted tree.
pub const fn root_id(self) -> ElementId
pub fn list_id(self) -> ElementId
pub const fn active_value(self) -> Option<ElementId>
pub const fn activates_on_focus(self) -> bool
pub const fn loops_focus(self) -> bool
pub const fn keeps_panels_mounted(self) -> bool
Sourcepub const fn activation_movement(self, movement: TabsActivationMovement) -> Self
pub const fn activation_movement(self, movement: TabsActivationMovement) -> Self
Declare which way the selection travelled, for a descriptor built without a TabsState.
Sourcepub const fn activation_direction(self) -> TabsActivationDirection
pub 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.
Sourcepub fn indicator_geometry(
self,
handle: &AnchorPlacementHandle,
) -> Option<TabsIndicatorGeometry>
pub fn indicator_geometry( self, handle: &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.
Sourcepub fn root_with(self, root: Element) -> Element
pub fn root_with(self, root: Element) -> Element
Decorate an application-owned structural root without adding role or appearance.
Sourcepub fn root(self) -> Element
pub fn root(self) -> Element
Create the unstyled root part. Use Self::root_with to supply an existing element.
Sourcepub fn list(self) -> Element
pub fn list(self) -> Element
Create the unstyled list part. Use Self::list_with to supply an existing element.
pub fn tab(self, value: impl Into<ElementId>) -> Tab
Trait Implementations§
impl Copy for Tabs
impl Eq for Tabs
impl StructuralPartialEq for Tabs
Auto Trait Implementations§
impl Forget for Tabs
impl Freeze for Tabs
impl Move for Tabs
impl RefUnwindSafe for Tabs
impl Send for Tabs
impl Sync for Tabs
impl Unpin for Tabs
impl UnsafeUnpin for Tabs
impl UnwindSafe for Tabs
Blanket Implementations§
impl<T> Action for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.