Expand description
Reusable paint helpers for window-style chrome — shadow halo, rounded body fill, title-bar fill, collapse chevron, outer border.
Why this module exists: the Window widget owns a
lot of behaviour (drag, resize, maximize, close, snap, backbuffer)
that other “framed” UI elements don’t want. AtomArtist’s node
editor — and any other consumer that wants the same drop-shadow +
rounded-corner look — can call these stateless paint functions
directly without inheriting the rest of Window.
All coords are local to the framed region (origin at bottom-left,
Y-up — agg-gui convention). The caller is responsible for
translating the DrawCtx into the frame’s local space before
invoking these helpers.
Structs§
- Chrome
Style - Geometry + colour bundle for a window-style frame. Construct one
per paint pass; default presets come from
ChromeStyle::from_visuals(matches the liveWindowwidget exactly).
Functions§
- paint_
chevron - Paint the collapse / expand chevron at
(cx, cy)in the activeDrawCtxspace. Half-size 4 px. Iconography matches conventional UIs: ▸ when collapsed (click to expand), ▾ when expanded (click to collapse). agg-gui is Y-up, so “▾” has its apex at the LOWER y. - paint_
chrome_ body - Paint the rounded body fill. When
collapsedis true the body occupies the fullhwith all four corners rounded; otherwise the title-bar strip at the top is excluded (the caller paints that separately so the top corner radius reads as one shape, no overlapping fills). - paint_
chrome_ border - Stroked outer border that frames body + title together.
- paint_
chrome_ shadow - Paint the stacked-rounded-rect drop shadow that frames a window. Drawn outside-in so the denser core overlays the softer halo.
- paint_
chrome_ title_ bar - Paint the title-bar fill + 1-px bottom separator + title label.
Does not paint the chevron or any buttons — those are real
child widgets (
crate::widgets::ChevronWidgetet al.) the caller composes into the title bar’s child list. This keeps interaction (click + hover + focus) flowing through the standard parent/child event dispatch instead of manual coordinate hit-tests.