docs
Loading...
Searching...
No Matches
ContainerOptions

#include <AppCore/layout/Options.h>

Overview

Configuration options for a row or column container.

You pass ContainerOptions to Container::AddRow() or Container::AddColumn() when adding a container to a window's layout tree. These options configure the container's own size within its parent, alongside spacing and divider behavior for its direct children.

This creates a resizable row with child spacing and outer padding:

RefPtr<Container> body = window->layout()->AddRow(
{ .key = "body", .resizable = true, .gap = 4, .padding = 8 });
A nullable smart pointer.
Definition RefPtr.h:126

Options Shared with Panels

Because a container is also a layout child, it shares its sizing, constraints, and visibility options with PanelOptions. These fields govern how the container behaves within its parent container (see PanelOptions).

Dividers and Spacing

Settings on the container and its children control interactive divider behavior between panes:

  • A container's resizable option enables dividers between all direct children. Dragging a divider redistributes space between the panes on either side.
  • A child node's fixed option preserves that child's size. Divider drags on either side can't resize a fixed pane.

To configure divider thickness and colors, call Container::SetDividerStyle() or Window::SetDividerStyle() (see DividerStyle).

Container options configure empty space around and between direct children:

  • The gap option separates adjacent direct children along the layout axis. Unset gap leaves no space between children.
  • The padding option insets direct children from all four container edges. Unset padding places children flush against the container boundary.

Both properties accept only logical pixels. Percentage units are ignored with a warning.

See also
Container::AddRow(), Container::AddColumn(), Window::BuildLayout(), PanelOptions, DividerStyle

Public Attributes

String key
 Optional identity for lookup (Find()) and diagnostics.
Size size
 The container's size along its parent's axis.
Length min_size
 Minimum size constraint.
Length max_size
 Maximum size constraint.
bool fixed = false
 Whether or not the container is fixed (the user cannot resize it by dragging a divider).
bool resizable = false
 Whether or not the user can resize this container's children by dragging the dividers between them.
Length gap
 The gap between adjacent children (logical px only; other units are ignored with a warning).
Length padding
 Padding between the container's edges and its children, applied on all four sides (logical px only).
bool hidden = false
 Whether or not the container is created hidden (its whole subtree is hidden with it).

Member Data Documentation

◆ fixed

bool fixed = false

Whether or not the container is fixed (the user cannot resize it by dragging a divider).

◆ gap

Length gap

The gap between adjacent children (logical px only; other units are ignored with a warning).

Unset means no gap.

◆ hidden

bool hidden = false

Whether or not the container is created hidden (its whole subtree is hidden with it).

◆ key

String key

Optional identity for lookup (Find()) and diagnostics.

Empty means unkeyed.

◆ max_size

Length max_size

Maximum size constraint.

Percentages are relative to the parent's content box (inside its padding). Unset means no maximum.

◆ min_size

Length min_size

Minimum size constraint.

Percentages are relative to the parent's content box (inside its padding). Unset means no minimum.

◆ padding

Length padding

Padding between the container's edges and its children, applied on all four sides (logical px only).

Unset means no padding.

◆ resizable

bool resizable = false

Whether or not the user can resize this container's children by dragging the dividers between them.

◆ size

Size size

The container's size along its parent's axis.

Unset means one flex share (1fr).


The documentation for this struct was generated from the following file: