mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
Allow user to specify window element border. (#849)
This commit is contained in:
parent
7e3e1d4bca
commit
d38b14ffb6
@ -80,7 +80,9 @@ Decorator borderStyled(BorderStyle);
|
|||||||
Decorator borderStyled(BorderStyle, Color);
|
Decorator borderStyled(BorderStyle, Color);
|
||||||
Decorator borderStyled(Color);
|
Decorator borderStyled(Color);
|
||||||
Decorator borderWith(const Pixel&);
|
Decorator borderWith(const Pixel&);
|
||||||
Element window(Element title, Element content);
|
Element window(Element title,
|
||||||
|
Element content,
|
||||||
|
BorderStyle border = ROUNDED);
|
||||||
Element spinner(int charset_index, size_t image_index);
|
Element spinner(int charset_index, size_t image_index);
|
||||||
Element paragraph(const std::string& text);
|
Element paragraph(const std::string& text);
|
||||||
Element paragraphAlignLeft(const std::string& text);
|
Element paragraphAlignLeft(const std::string& text);
|
||||||
|
@ -479,6 +479,7 @@ Element borderEmpty(Element child) {
|
|||||||
/// @brief Draw window with a title and a border around the element.
|
/// @brief Draw window with a title and a border around the element.
|
||||||
/// @param title The title of the window.
|
/// @param title The title of the window.
|
||||||
/// @param content The element to be wrapped.
|
/// @param content The element to be wrapped.
|
||||||
|
/// @param border The style of the border. Default is ROUNDED.
|
||||||
/// @ingroup dom
|
/// @ingroup dom
|
||||||
/// @see border
|
/// @see border
|
||||||
///
|
///
|
||||||
@ -488,6 +489,12 @@ Element borderEmpty(Element child) {
|
|||||||
/// Element document = window(text("Title"),
|
/// Element document = window(text("Title"),
|
||||||
/// text("content")
|
/// text("content")
|
||||||
/// );
|
/// );
|
||||||
|
///
|
||||||
|
/// // With specifying border
|
||||||
|
/// Element document = window(text("Title"),
|
||||||
|
/// text("content"),
|
||||||
|
/// ROUNDED
|
||||||
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ### Output
|
/// ### Output
|
||||||
@ -497,8 +504,8 @@ Element borderEmpty(Element child) {
|
|||||||
/// │content│
|
/// │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)),
|
return std::make_shared<Border>(unpack(std::move(content), std::move(title)),
|
||||||
ROUNDED);
|
border);
|
||||||
}
|
}
|
||||||
} // namespace ftxui
|
} // namespace ftxui
|
||||||
|
Loading…
Reference in New Issue
Block a user