zng_wgt_stack

Function stack_nodes_layout_by

source
pub fn stack_nodes_layout_by(
    nodes: impl UiNodeList,
    index: impl IntoVar<usize>,
    constraints: impl Fn(PxConstraints2d, usize, PxSize) -> PxConstraints2d + Send + 'static,
) -> impl UiNode
Expand description

Basic z-stack node sized by one of the items.

Creates a node that updates the nodes in the logical order they appear, renders them one on top of the other from back(0) to front(len-1), but layouts the index item first and uses its size to get constraints for the other items.

The layout size is the largest item width and height, usually the index size.

If the index is out of range the node logs an error and behaves like stack_nodes.