Skip to main content

Module overlay

Module overlay 

Source
Expand description

The single overlay primitive: a generic popup driver plus the dimming backdrop shared by every modal, picker and overlay.

popup runs one blocking overlay. It dims the screen behind a centered box (the underlying view stays visible but darkened), draws a caller-owned box, and routes keys until the caller’s handler resolves. Every blocking widget in this toolkit is a thin wrapper over it, so the loop/Clear/ centering scaffolding lives here once (SSOT) instead of in each widget.

Enums§

PopupFlow
What a popup key handler decides after each key.

Functions§

dim
Dims every cell currently in the frame toward black by factor, preserving the drawn content. Rgb cells are darkened; cells with a non-Rgb foreground (which has no RGB base to scale) get the terminal DIM attribute.
framed
Draws the shared rounded modal frame into rect and returns the inner area for the caller’s content. Wraps modal_block so the box chrome stays a single source of truth.
popup
Runs one blocking popup and returns its outcome.