18class Hyperlink :
public NodeDecorator {
20 Hyperlink(
Element child, std::string link)
21 : NodeDecorator(std::move(child)),
link_(std::move(link)) {}
23 void Render(Screen& screen)
override {
24 const uint8_t hyperlink_id = screen.RegisterHyperlink(link_);
25 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
26 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
27 screen.CellAt(x, y).hyperlink = hyperlink_id;
53 return std::make_shared<Hyperlink>(std::move(child), std::string(link));
72 return [link = std::string(link)](
Element child) {
friend void Render(Screen &screen, Node *node, Selection &selection)
Decorator hyperlink(std::string_view link)
Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
The FTXUI ftxui:: namespace.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element