mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Update document WIP.
This commit is contained in:

committed by
Arthur Sonzogni

parent
177df31d41
commit
75c424cea9
@@ -83,10 +83,33 @@ class Flex : public Node {
|
||||
FlexFunction f_;
|
||||
};
|
||||
|
||||
/// @brief An element that will take expand proportionnally to the space left in
|
||||
/// a container.
|
||||
/// @ingroup dom
|
||||
Element filler() {
|
||||
return std::make_shared<Flex>(function_flex);
|
||||
}
|
||||
|
||||
/// @brief Make a child element to expand proportionnally to the space left in a
|
||||
/// container.
|
||||
///
|
||||
/// #### Examples:
|
||||
///
|
||||
/// ~~~cpp
|
||||
/// hbox({
|
||||
/// text(L"left") | border ,
|
||||
/// text(L"middle") | border | flex,
|
||||
/// text(L"right") | border,
|
||||
/// });
|
||||
/// ~~~
|
||||
///
|
||||
/// #### Output:
|
||||
///
|
||||
/// ~~~bash
|
||||
/// ┌────┐┌─────────────────────────────────────────────────────────┐┌─────┐
|
||||
/// │left││middle ││right│
|
||||
/// └────┘└─────────────────────────────────────────────────────────┘└─────┘
|
||||
/// ~~~
|
||||
Element flex(Element child) {
|
||||
return std::make_shared<Flex>(function_flex, std::move(child));
|
||||
}
|
||||
|
Reference in New Issue
Block a user