Skip to main content

Module tab_strip

Module tab_strip 

Source
Expand description

Tab strip — horizontal row of tab pills above the input bar / statusline.

Layout (top to bottom in the buffr window):

+---------------------------------------------+
| input bar (when overlay open)               |
+---------------------------------------------+
| tab strip — TAB_STRIP_HEIGHT px             |
+---------------------------------------------+
| CEF child window (page area)                |
+---------------------------------------------+
| statusline — STATUSLINE_HEIGHT px           |
+---------------------------------------------+

Each tab is a fixed-width pill. The active tab uses the mode-accent colour at full intensity; inactive tabs are dimmed. Pinned tabs show a leading * glyph and sort first (sorting is the host’s job; this widget only renders what it’s given).

The widget owns no state and pulls no winit / softbuffer types into its public API; like crate::Statusline, embedders pass a raw &mut [u32] slice each frame.

Loading indicator: a 2-px progress bar at the bottom edge of each tab. progress >= 1.0 is treated as idle and the bar is hidden.

Structs§

TabFavicon
Decoded favicon bitmap, BGRA u32 packed (0xAARRGGBB). Wrapped in Arc so cloning a TabView is O(1).
TabStrip
Whole-strip render input. Re-create per frame — the widget owns no state. palette is set once on startup from config.theme and drives every colour the widget paints.
TabView
Per-tab render input. progress >= 1.0 hides the loading bar.

Constants§

FAVICON_RENDER_SIZE
Target favicon side length in the strip, in pixels.
MAX_TAB_WIDTH
Maximum width of a single tab pill in pixels. Beyond this the titles get long enough to be hard to glance at.
MIN_TAB_WIDTH
Minimum width of a single tab pill in pixels. With 8 px gutter the layout falls back to overflow truncation when the strip is too narrow.
PINNED_TAB_WIDTH
Compact width for pinned tabs. Pinned tabs render as a square icon-only pill — no title text, just the favicon (or a fallback initial) — so the user can fit many anchors in a small strip.
TAB_STRIP_HEIGHT
Tab strip strip height in pixels. 34 px gives a 14-px glyph row with comfortable padding above + below plus a 2-px progress bar reserved at the bottom. Bumping this requires the host window to re-layout the CEF child rect.