35 class Impl :
public ComponentBase {
37 Impl(ConstStringRef label,
Component child, Ref<bool> show) : show_(show) {
39 opt.transform = [](EntryState s) {
40 auto prefix =
text(s.state ?
"▼ " :
"▶ ");
41 auto t =
text(s.label);
48 return hbox({prefix, t});
51 Checkbox(label, show_.operator->(), opt),
52 Maybe(std::move(child), show_.operator->()),
58 return Make<Impl>(std::move(label), std::move(child), show);
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
Component Checkbox(CheckboxOption options)
std::shared_ptr< ComponentBase > Component
Element bold(Element)
Use a bold font, for elements with more emphasis.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Element text(std::wstring text)
Display a piece of unicode text.
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)