mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-12-11 21:56:10 +08:00
Fix build issues.
This commit is contained in:
parent
b22241ec52
commit
2aafd068cc
@ -89,7 +89,6 @@ add_library(dom
|
||||
src/ftxui/dom/paragraph.cpp
|
||||
src/ftxui/dom/reflect.cpp
|
||||
src/ftxui/dom/scroll_indicator.cpp
|
||||
src/ftxui/dom/selectable.cpp
|
||||
src/ftxui/dom/selection.cpp
|
||||
src/ftxui/dom/separator.cpp
|
||||
src/ftxui/dom/size.cpp
|
||||
|
@ -1,38 +0,0 @@
|
||||
// Copyright 2024 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
||||
#include "ftxui/component/event.hpp" // for Event
|
||||
#include "ftxui/dom/elements.hpp" // for Element, Decorator
|
||||
#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
|
||||
|
||||
namespace ftxui {
|
||||
namespace {
|
||||
|
||||
class Selectable : public NodeDecorator {
|
||||
public:
|
||||
explicit Selectable(Element child) : NodeDecorator(std::move(child)) {}
|
||||
|
||||
private:
|
||||
void Render(Screen& screen) override {
|
||||
for (int y = box_.y_min; y <= box_.y_max; ++y) {
|
||||
for (int x = box_.x_min; x <= box_.x_max; ++x) {
|
||||
screen.PixelAt(x, y).selectable = true;
|
||||
}
|
||||
}
|
||||
|
||||
NodeDecorator::Render(screen);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
Element selectable(Element child) {
|
||||
return std::make_shared<Selectable>(std::move(child));
|
||||
}
|
||||
|
||||
Decorator selectable(void) {
|
||||
return [](Element child) { return selectable(std::move(child)); };
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
Loading…
Reference in New Issue
Block a user