Skip to main content

Module panel

Module panel 

Source
Expand description

Panels: the translucent backdrops the interface’s text sits on, so a list stays readable over a bright scene.

A panel is a rounded rectangle in the theme’s panel fill, with a 1 px lit edge in panel_edge and, optionally, a faint scanline modulation every scanline_pitchth row — every value from THEME, so a panel carries no colour of its own. The same pass draws the row highlight (PanelKind::Highlight), which is why the selection can glide under text without a second pipeline.

All of a frame’s panels are one instanced draw, recorded by the text layer before its glyphs in the same pass. The rounded corners, the edge and the scanlines are computed per fragment from the panel’s rectangle, so there is no texture and no bind group.

Structs§

Panel
One panel, in device pixels from the target’s top-left — the coordinate space a TextRun uses.

Enums§

PanelKind
The two things a panel rectangle can be.

Constants§

HIGHLIGHT_BAR_W
Width of a highlight’s accent bar, device pixels.