Skip to main content

Module material

Module material 

Source
Expand description

material — the material-glass float: wraps a popover/dialog card so its ENTIRE subtree paints inside one scene layer (a single draw order).

The single layer order is the point: with per-primitive bounds-tree ordering, a hover repaint elsewhere can reassign the card’s quads relative to siblings — inside one layer the card’s stacking is structural.

The blur is painted first, structurally under the content: inside one layer the order is blur, then shadow, tint, border, rows, text. It needs Window::paint_backdrop_blur from our gpui fork (macOS Metal only); elsewhere the primitive is ignored and the glass reads as the theme’s translucent tint over the OS window blur.

Structs§

Layered
Material

Constants§

MENU_BLUR
Backdrop-blur sigma for floating menu/dialog glass — the reference .glass-surface runs blur(44px), and the Theme::glass_overlay tint is thin enough that a 16px blur leaves backdrop detail ghosting through rows.
PANEL_BLUR
Backdrop-blur sigma for a small floating panel — a meter, a HUD. A sigma is only frost while the box is wide enough to show what it softened; at a quarter of the box’s width the backdrop resolves to one flat tone.

Traits§

Frosted
Frost this card at the corner radius it already carries.

Functions§

layered
Paint child in its own scene layer, giving it a fresh draw order above everything painted so far in the enclosing layer.
material
Frost a card whose rounding the caller states — the shape the popover layers need, where the card arrives already erased to an AnyElement and its radius belongs to the surface kind. Backdrop-blurred on glass, pass-through on opaque platforms.