16#include "GuiGeometry.h"
39 float left, top, right, bottom;
40 GuiInsets(
float all = 0.0f) : left(all), top(all), right(all), bottom(all) {}
41 GuiInsets(
float horizontal,
float vertical) : left(horizontal), top(vertical), right(horizontal), bottom(vertical) {}
42 GuiInsets(
float l,
float t,
float r,
float b) : left(l), top(t), right(r), bottom(b) {}
69struct GuiLayoutResult {
71 std::vector<GuiRect> rects;
72 GuiLayoutResult() : width(0), height(0) {}
94 float spacingX, spacingY;
96 GuiGridSpec() : columns(1), spacingX(0), spacingY(0), fixedW(0),
fixedH(0) {}
106struct GuiOverlayItem {
115struct GuiOverlaySpec {
118 GuiOverlaySpec() : fixedW(0),
fixedH(0) {}
@ UP
D-pad arrows: a circle with a triangle.
NAV_DIR
Directions for moving the selection.
LAYOUT_ALIGN
How an item sits across the main direction of a stack, or inside a grid cell.
GuiLayoutResult GuiSolveGrid(const GuiGridSpec &spec, const std::vector< GuiGridItem > &items)
Lays items out in rows.
int GuiNavigate(const std::vector< GuiNavItem > &items, int current, NAV_DIR dir)
Picks which item the selection moves to.
GuiLayoutResult GuiSolveStack(const GuiStackSpec &spec, const std::vector< GuiStackItem > &items)
Lays items out along one axis.
GuiLayoutResult GuiSolveOverlay(const GuiOverlaySpec &spec, const std::vector< GuiOverlayItem > &items)
Stacks items on top of each other in one box.
LAYOUT_JUSTIFY
How leftover space along a stack's main direction is spent (when no item grows).
@ STRETCH
Fills the available space.
@ SPACE_BETWEEN
First item at the start, last at the end, equal gaps between.
LAYOUT_ALIGN alignV
Placement inside the cell.
Rules for a grid, filled row by row.
float fixedH
Container size; 0 = fit.
Space around the inside edge of a container.
The solver's answer: the container's size and each item's rectangle.
An item that selection can move between.
GuiRect r
On-screen rectangle.
bool background
Fills the whole box, ignores padding, and does not count toward the fit size.
Rules for an overlay: children share one box.
float fixedH
Container size; 0 = fit.
An axis-aligned rectangle (top-left origin) in design-canvas pixels.
float h
Natural size (for a gap: its fixed size along the main axis).
float grow
Share of leftover main-axis space this item takes (0 = none).
bool useContainerAlign
true: use the stack's alignItems; false: use align.
LAYOUT_ALIGN align
Cross-axis alignment when not using the container's.
Rules for a row or column.
float spacing
Gap between neighbouring items.
bool vertical
true = column, false = row.
float fixedH
Container size; 0 = fit.