43 void addChild(std::unique_ptr<Component> child);
50 [[nodiscard]] std::string
render()
const override;
86 bool moveFocus(
int dir);
90 std::vector<std::unique_ptr<Component>>
92 size_t m_focused_index = 0;
Abstract base class for all TUI components.
A container widget that groups and lays out child Component objects.
Definition ComponentGroup.hpp:25
void setFocused(bool focused) override
Propagate focus state changes to the currently focused child.
Definition ComponentGroup.cpp:19
void addChild(std::unique_ptr< Component > child)
Append a child component to the bottom of the group.
Definition ComponentGroup.cpp:15
bool handleInput(Defs::Key key) override
Handle a key event, routing it to the focused child or managing focus.
Definition ComponentGroup.cpp:109
std::string render() const override
Render the group and all its children as a multi-line ANSI string.
Definition ComponentGroup.cpp:53
Abstract base for all TUI widgets.
Definition Component.hpp:38
std::variant< char, Special > Key
A single keypress from stdin, represented as either a printable character or a Special control key.
Definition Defs.hpp:45