Expand description
Pango-bordered tooltip primitives shared by every vendor renderer.
Extracted from the per-vendor implementations because every tooltip (Anthropic, OpenAI, Z.AI, OpenRouter) draws the same kind of box: blue corners + horizontals, dim separators, centered title, left-padded body lines. The only thing that varies is the line content.
Mirrors the visual style of claudebar’s ${B}╭${border_h}╮${E} block
(claudebar:843-859).
Structs§
- Window
Row - Optional decorations for a
push_windowrow.Defaultreproduces the plain row every vendor drew before pacing reached the tooltip: bar + percentage, then⏱ Resets in ….
Enums§
- Line
- One row of the bordered tooltip box.
Functions§
- pad_
center - Pad
ssymmetrically; when the difference is odd, the extra space goes on the right (claudebarcenter_padprecedent). - pad_
right - Pad
son the right with spaces so its visible width reachesinner_w. - push_
window - Append the standard three-line block every vendor uses for a usage window: icon + label, progress bar + bold percentage, then the dim reset countdown.
- push_
window_ with_ detail push_window_with_row, with an optional vendor-specific detail appended to the percentage line. Spend-based vendors use this for values such as “$1.23 of $14.00” while keeping the same label / gauge / reset rhythm as percentage-based vendors such as OpenAI.- push_
window_ with_ row push_window, plus the optional decorations aWindowRowcarries.- render_
bordered - Render the bordered tooltip. Width is computed from the widest body/center line so different vendors auto-size correctly.