Skip to content

Layout

#include <Layout.hpp>

Subclassed by: AbsoluteLayout, GridLayout, StackLayout

Abstract base class for layout engines.

Implement this to create custom layouts. The apply() method is called with a list of child widgets and their specs, and should position each child by setting their rect field.

ReturnNameDescription
voidapplyApplies the layout algorithm to position children.

void apply(std::vector< ChildSlot > & children, Rect inner)

Applies the layout algorithm to position children.

This method should position each child by modifying its rect field. The framework calls measure() before layout(), so you can inspect each widget’s measured size.

  • children The child widgets with their layout specs

  • inner The inner area available for children (accounting for borders/padding)