mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-10-01 17:29:07 +08:00
Merge dom and component focus (#978)
Instead of two levels of focus with `focus` and `selected`, use a recursive level. The components set the one "active" and hbox/vbox/dbox Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -24,8 +24,8 @@ Component Maybe(Component child, std::function<bool()> show) {
|
||||
explicit Impl(std::function<bool()> show) : show_(std::move(show)) {}
|
||||
|
||||
private:
|
||||
Element Render() override {
|
||||
return show_() ? ComponentBase::Render() : std::make_unique<Node>();
|
||||
Element OnRender() override {
|
||||
return show_() ? ComponentBase::OnRender() : std::make_unique<Node>();
|
||||
}
|
||||
bool Focusable() const override {
|
||||
return show_() && ComponentBase::Focusable();
|
||||
|
Reference in New Issue
Block a user