Skip to main content

Module tabs

Module tabs 

Source
Expand description

<tabs> strip-button runtime.

The markup-level <tabs bind-value="active"> <tab name="general" label="General">...</tab> ... </tabs> parser pass synthesises one <button class="tab-btn"> per tab and tags each with a TabStripButton component. This plugin’s tiny dispatcher watches ClickEvents, looks up the matching button, and writes Signals[signal_name] = tab_value - no author-side script required for the basic “switch active tab” flow.

Structs§

DropdownButton
<dropdown> toggle marker attached by the parser to the dropdown header button. Clicks flip Signals[open_signal] between "true" and "false".
DropdownOptionButton
<option> button inside a <dropdown> panel. Click writes Signals[value_signal] = value and closes the panel by writing Signals[open_signal] = "false".
DropdownOptionSpec
One <option>’s metadata mirrored onto the dropdown header (markup order). Carried on DropdownButton so the closed combobox can run keyboard interaction - Up/Down value stepping and type-ahead - before the panel body (and its DropdownOptionButton entities) has ever mounted (<if> bodies spawn lazily on first open).
MenuItemButton
<menu> item marker. Clicks emit MenuClicked with the item id and close the menu by writing the open signal to "false".
TabButtonStyle
Per-tab-button track fills, resolved at spawn from markup / CSS. sync_tab_button_visuals swaps Visuals::fill between the two as the Selected marker is added to / removed from the button - same pattern as [crate::controls::ToggleStyle] / crate::controls::sync_toggle_visuals for <toggle>.
TabStripButton
Strip-button marker. (signal_name, tab_value) - clicking writes Signals[signal_name] = tab_value. Authored only by the <tabs> parser pass; not exposed to markup directly.
TabsPlugin
Plugin: registers the click dispatcher in TickStage::Systems after lumen-input’s dispatch_clicks so we observe the same frame’s clicks.

Constants§

TAB_SELECTED_BG
Default fill for a .tab-btn:selected when no author / skin :selected { bg: ... } rule matched. Mirrors the default skin’s --lumen-accent (#33c7ce) so a bare <tabs> with no CSS still shows which tab is active.

Functions§

apply_a11y_expand_to_dropdown
Mirrors A11yState::EXPANDED onto the dropdown’s open-state signal whenever the bit changes.
dispatch_dropdown_clicks
<dropdown> click dispatcher. Toggles the open-panel signal on header clicks; writes the selected value and closes the panel on option clicks.
dispatch_menu_item_clicks
<menu> item click dispatcher. Emits MenuClicked and closes the menu panel in the same tick.
dispatch_tab_keys
Keyboard navigation for tab strips, scoped to children of a tab list (i.e. siblings of the focused TabStripButton). Matches the QTabBar keyboard contract:
sync_tab_button_visuals
Keep a tab-strip button’s visuals in step with whether it currently carries Selected: swap Visuals::fill between TabButtonStyle::selected_bg / TabButtonStyle::unselected_bg. The fill is held in StyleOverrides under the hover and press tints, so a tint releases onto the current state colour rather than a stale one - mirrors crate::controls::sync_track_fill.
sync_tab_selected
Maintain the Selected marker across every tab strip: the button whose value matches its bound signal’s current value carries it; all its siblings shed it. Idempotent per tick - insert / remove only fire on actual transitions, so archetypes stay put on idle frames.