mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Implement flexbox (#277)
This implement the flexbox elements, following the HTML one. Built from them, there is also the following elements: - `paragraph` - `paragraphAlignLeft` - `paragraphAlignRight` - `paragraphAlignCenter` - `paragraphAlignJustify` This is a breaking change.
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex, flex_grow, Elements, flex_shrink, vtext, gridbox, vbox, border
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/box.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, TEST, EXPECT_EQ
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
@@ -24,6 +24,14 @@ Element cell(const char* t) {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST(GridboxTest, UnfilledRectangular) {
|
||||
auto root = gridbox({
|
||||
{text("1"), text("2"), text("3"), text("4")},
|
||||
{},
|
||||
{},
|
||||
});
|
||||
}
|
||||
|
||||
TEST(GridboxTest, DifferentSize) {
|
||||
auto root = gridbox({
|
||||
{cell("1"), cell("22"), cell("333")},
|
||||
|
||||
Reference in New Issue
Block a user