Skip to main content

Module render

Module render 

Source
Expand description

The single rendering entry point: [render]. The engine: turn an AppLayout into an iced::Element.

This is the only place in snora where composition of layers, backdrops, and z-order happens. Nothing else in the framework mutates layer state, and application code never touches [iced::widget::stack] directly when using snora.

§Layer order (bottom to top)

0. skeleton          — header + (side_bar | body) + footer
1. menu backdrop     — transparent mouse_area, dispatches on_close_menus
2. header_menu       — dropdown under the header bar
3. context_menu      — floating menu at click point
4. modal backdrop    — 40%-dim mouse_area, dispatches on_close_modals
5. dialog            — centered; token-styled card via `design::render`
6. sheet             — edge-anchored panel, size per SheetSize
7. toasts            — stacked at the configured ToastPosition (RTL-aware),
                       newest toast closest to the anchor edge

This order is part of the framework contract. See the overlay interaction semantics reference page for the normative behavioral rules.

Layers 1–6 are conditional on the corresponding AppLayout fields being populated. Layer 7 is always evaluated but emits nothing when the toast queue is empty.

§Graceful degradation

When overlay content is present but the matching on_close_* handler is None, the engine still renders the content. It simply omits the click-outside backdrop. This lets applications opt into explicit close buttons instead of click-outside-to-close without silently losing their overlays.

Functions§

render
Compile an AppLayout into an iced Element.