mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 04:31:34 +08:00
Remove unused file. (#244)
It was added mistakenly in: https://github.com/ArthurSonzogni/FTXUI/pull/214#pullrequestreview-786773967 but @robinlinden found it.
This commit is contained in:
parent
cba11151b5
commit
c0e47aecb2
@ -1,30 +0,0 @@
|
||||
#include "ftxui/component/component_base.hpp"
|
||||
|
||||
Component Maybe(Component child, bool* show) {
|
||||
class Impl : public ComponentBase {
|
||||
public:
|
||||
Impl(Component child, bool* show) : ComponentBase(child), show_(show) {}
|
||||
|
||||
private:
|
||||
Element Render() override {
|
||||
if (*show_)
|
||||
return ComponentBase::Render();
|
||||
else
|
||||
return text("");
|
||||
}
|
||||
bool Focusable() const override {
|
||||
return *show_ && ComponentBase::Focusable();
|
||||
}
|
||||
bool OnEvent(Event event) override {
|
||||
if (*show_)
|
||||
return false return ComponentBase::OnEvent(event);
|
||||
}
|
||||
|
||||
bool* show_;
|
||||
};
|
||||
return Make<Impl>(std::move(child), show);
|
||||
}
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
Loading…
Reference in New Issue
Block a user