docs
Loading...
Searching...
No Matches
PanelOptions

#include <AppCore/layout/Options.h>

Overview

Configuration options for a panel in a row or column.

Pass PanelOptions to Container::AddPanel() or Window::AddPanel() when adding a panel to a window layout. It declares how the panel shares space with sibling nodes along its parent container's axis.

The following example creates a resizable row with a sized sidebar and a default content panel:

RefPtr<Container> body = window->layout()->AddRow({ .resizable = true });
RefPtr<Panel> sidebar =
body->AddPanel({ .key = "sidebar", .size = "240px", .min_size = "160px" });
RefPtr<Panel> content = body->AddPanel(); // one flex share
A nullable smart pointer.
Definition RefPtr.h:126

Defaults and Sizing

Every field is optional. Passing an empty {} gives an unkeyed panel that takes one flex share (1fr).

For the supported size units, see Size and Length.

Panel Keys

Setting key assigns a string identifier to the panel for diagnostics and retrieval. You can look up the panel later by passing its key to Window::FindPanel() or Container::Find().

See also
Container::AddPanel(), Window::AddPanel(), Size, Length, ContainerOptions

Public Attributes

String key
 Optional identity for lookup (Find()) and diagnostics.
Size size
 The panel's size along its container's axis.
Length min_size
 Minimum size constraint.
Length max_size
 Maximum size constraint.
bool fixed = false
 Whether or not the panel is fixed (the user cannot resize it by dragging a divider).
bool hidden = false
 Whether or not the panel is created hidden.

Member Data Documentation

◆ fixed

bool fixed = false

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

◆ hidden

bool hidden = false

Whether or not the panel is created hidden.

A hidden panel keeps its declared size and shows later without a layout flash.

◆ key

String key

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

Empty means unkeyed, which is fully supported.

Note
Duplicate keys log a warning, and Find() returns the most recently created match.

◆ max_size

Length max_size

Maximum size constraint.

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

◆ min_size

Length min_size

Minimum size constraint.

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

◆ size

Size size

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

Unset means one flex share (1fr). For what each unit means, see Size.


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