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.
Glass::glass_effect is the liquid surface: a bevel at the rim that
refracts the backdrop, and a fill of its own.
Structs§
Constants§
- MENU_
BLUR - Backdrop-blur sigma for floating menu/dialog glass — the reference
.glass-surfacerunsblur(44px), and theTheme::glass_overlaytint 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§
- Glass
- The backdrop surfaces, on any element carrying a corner radius.
Functions§
- layered
- Paint
childin its own scene layer, giving it a fresh draw order above everything painted so far in the enclosing layer. - lensed
- Whether
Glass::glass_effectwill actually refract here, rather than falling back to the flat backdrop tint. The primitive is macOS Metal’s, and an opaque appearance has nothing behind it to lens. - material
- Frost a card whose rounding the caller states — the shape the popover layers
need, where the card arrives already erased to an
AnyElementand its radius belongs to the surface kind. Backdrop-blurred on glass, pass-through on opaque platforms.