foxygit / Torlinkc Log in
commits tags

/include/torlinkc/ui/colored_window.hpp · 673 B

raw
#pragma once

#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/color.hpp>

namespace torlinkc::ui {

// Same as ftxui::window(title, content), but with the border (including the
// title text embedded in it) tinted `color` -- interior `content` keeps
// whatever colors it set for itself, untouched. The installed FTXUI's public
// window() has no color parameter (its color-capable Border node is an
// internal, unexported class), so this is a small adaptation of that node
// (FTXUI is MIT-licensed) exposed as a free function instead.
ftxui::Element coloredWindow(ftxui::Element title, ftxui::Element content, ftxui::Color color);

}  // namespace torlinkc::ui