Skip to content

core

NameDescription
ContextCentralized application context holding global state and managers.
FocusManagerManages focus among widgets, including traversal and event dispatching.
LayoutAbstract base class for layout engines.
OverlayManagerManages floating widgets that render above the main widget tree.
WidgetThe base class for all UI components.
BorderDescribes the border styling for a widget.
BorderChars
BorderLabelRepresents a label that can be displayed on a border edge of a widget.
ChildSlotInternal structure pairing a widget with its layout spec.
ColorRepresents an RGB color with optional transparency.
LayoutSpecSpecifies how a widget should be sized and positioned within its layout slot.
MarginSpecSpecifies spacing around all four sides.
PaddingSpecSpecifies padding on all four sides of a widget’s content area.
PosRepresents a position in 2D space.
RectRepresents a rectangular region in 2D space.
ScalarSpecRepresents a single dimension value that can be absolute or percentage-based.
SizeRepresents dimensions in cells.
StyleDescribes the visual appearance of a widget.
TextDecorationRepresents text styling options such as bold, underline, and italic.
NameDescription
AlignSpecifies alignment within a container or space.
BorderStyleSpecifies the style of border to draw around widgets.

enum Align

Specifies alignment within a container or space.

Used for both horizontal and vertical alignment of content within widgets and layout slots.

ValueDescription
StartAlign to the start (left for horizontal, top for vertical)
CenterAlign to the center.
EndAlign to the end (right for horizontal, bottom for vertical)
StretchStretch to fill the available space.

enum BorderStyle

Specifies the style of border to draw around widgets.

Different border styles use different Unicode box-drawing characters.

ValueDescription
NoneNo border.
SingleSingle-line border: ─ │ ┌ ┐ └ ┘
DoubleDouble-line border: ═ ║ ╔ ╗ ╚ ╝
RoundedRounded corners: ─ │ ╭ ╮ ╰ ╯
ThickThick border: ━ ┃ ┏ ┓ ┗ ┛
DashedDashed border: ╌ ╎
ReturnNameDescription
ScalarSpecpct inlineHelper to create a percentage-based ScalarSpec.
ScalarSpeccells inlineHelper to create an absolute cell-based ScalarSpec.
std::shared_ptr< Widget >topOverlayRoot static
voiddrawBorderLine

inline

inline ScalarSpec pct(float v)

Helper to create a percentage-based ScalarSpec.

  • v The percentage value (0-100)

A ScalarSpec representing v% of parent size


inline

inline ScalarSpec cells(float v)

Helper to create an absolute cell-based ScalarSpec.

  • v The size in cells

A ScalarSpec representing v cells


static

static std::shared_ptr< Widget > topOverlayRoot()

void drawBorderLine(backend::Buffer & buf, int y, int x0, int x1, const std::vector< BorderLabel > & labels, const Style & s)
ReturnNameDescription
const BorderCharsborderSets static

static

const BorderChars borderSets = {
{},
{"\xe2\x94\x80", "\xe2\x94\x82", "\xe2\x94\x8c", "\xe2\x94\x90",
"\xe2\x94\x94", "\xe2\x94\x98"},
{"\xe2\x95\x90", "\xe2\x95\x91", "\xe2\x95\x94", "\xe2\x95\x97",
"\xe2\x95\x9a", "\xe2\x95\x9d"},
{"\xe2\x94\x80", "\xe2\x94\x82", "\xe2\x95\xad", "\xe2\x95\xae",
"\xe2\x95\xb0", "\xe2\x95\xaf"},
{"\xe2\x94\x81", "\xe2\x94\x83", "\xe2\x94\x8f", "\xe2\x94\x93",
"\xe2\x94\x97", "\xe2\x94\x9b"},
{"\xe2\x95\x8c", "\xe2\x95\x8e", "\xe2\x94\x8c", "\xe2\x94\x90",
"\xe2\x94\x94", "\xe2\x94\x98"},
}