Allow user to specify window element border. (#849)

This commit is contained in:
Mark Antabi
2024-04-28 08:48:02 -04:00
committed by GitHub
parent 7e3e1d4bca
commit d38b14ffb6
2 changed files with 12 additions and 3 deletions

View File

@@ -479,6 +479,7 @@ Element borderEmpty(Element child) {
/// @brief Draw window with a title and a border around the element.
/// @param title The title of the window.
/// @param content The element to be wrapped.
/// @param border The style of the border. Default is ROUNDED.
/// @ingroup dom
/// @see border
///
@@ -488,6 +489,12 @@ Element borderEmpty(Element child) {
/// Element document = window(text("Title"),
/// text("content")
/// );
///
/// // With specifying border
/// Element document = window(text("Title"),
/// text("content"),
/// ROUNDED
/// );
/// ```
///
/// ### Output
@@ -497,8 +504,8 @@ Element borderEmpty(Element child) {
/// │content│
/// └───────┘
/// ```
Element window(Element title, Element content) {
Element window(Element title, Element content, BorderStyle border) {
return std::make_shared<Border>(unpack(std::move(content), std::move(title)),
ROUNDED);
border);
}
} // namespace ftxui