22 class Impl :
public ComponentBase {
24 explicit Impl(std::function<
bool()>
show) : show_(std::move(
show)) {}
28 return show_() ? ComponentBase::OnRender() : std::make_unique<Node>();
30 bool Focusable()
const override {
31 return show_() && ComponentBase::Focusable();
33 bool OnEvent(Event event)
override {
34 return show_() && ComponentBase::OnEvent(event);
37 std::function<bool()> show_;
41 maybe->Add(std::move(child));
59 return Maybe(std::move(child), std::move(
show));
Component Maybe(Component child, std::function< bool()> show)
Decorate a component |child|. It is shown only when |show| returns true.
The FTXUI ftxui:: namespace.
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::function< Component(Component)> ComponentDecorator
std::shared_ptr< ComponentBase > Component