mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-18 09:08:08 +08:00
Feature: the Modal
component. (#418)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <string> // for allocator
|
||||
#include <gtest/gtest.h> // for Test, AssertionResult, TestInfo (ptr only), EXPECT_TRUE, TEST
|
||||
#include <string> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, text, blink, Element
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen, Pixel
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_TRUE, TEST
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <string> // for allocator
|
||||
#include <gtest/gtest.h> // for Test, AssertionResult, TestInfo (ptr only), EXPECT_TRUE, TEST
|
||||
#include <string> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, text, bold, Element
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen, Pixel
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_TRUE, TEST
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#include "ftxui/dom/canvas.hpp"
|
||||
|
||||
#include <algorithm> // for max, min
|
||||
#include <cstdint> // for uint8_t
|
||||
#include <cstdlib> // for abs
|
||||
#include <map> // for allocator, map
|
||||
#include <memory> // for make_shared
|
||||
#include <utility> // for move, pair
|
||||
#include <vector> // for vector
|
||||
#include <algorithm> // for max, min
|
||||
#include <cstdint> // for uint8_t
|
||||
#include <cstdlib> // for abs
|
||||
#include <ftxui/screen/color.hpp> // for Color
|
||||
#include <map> // for map
|
||||
#include <memory> // for make_shared
|
||||
#include <utility> // for move, pair
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for Element, canvas
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <string> // for allocator
|
||||
#include <gtest/gtest.h> // for Test, AssertionResult, TestInfo (ptr only), EXPECT_TRUE, TEST
|
||||
#include <string> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, text, dim, Element
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen, Pixel
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_TRUE, TEST
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#include "ftxui/dom/flexbox_helper.hpp"
|
||||
|
||||
#include <algorithm> // for min, max
|
||||
#include <cstddef> // for size_t
|
||||
#include <memory> // for allocator_traits<>::value_type
|
||||
#include <utility> // for swap, move
|
||||
#include <algorithm> // for max, min
|
||||
#include <cstddef> // for size_t
|
||||
#include <ftxui/dom/flexbox_config.hpp> // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::Wrap, FlexboxConfig::Direction::RowInversed, FlexboxConfig::AlignItems, FlexboxConfig::Direction::Row, FlexboxConfig::Direction::Column, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Wrap::WrapInversed, FlexboxConfig::AlignContent::Stretch, FlexboxConfig::JustifyContent::Stretch, FlexboxConfig::Wrap::Wrap, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignContent::FlexEnd, FlexboxConfig::AlignContent::FlexStart, FlexboxConfig::AlignContent::SpaceAround, FlexboxConfig::AlignContent::SpaceBetween, FlexboxConfig::AlignContent::SpaceEvenly, FlexboxConfig::AlignItems::Center, FlexboxConfig::AlignItems::FlexEnd, FlexboxConfig::AlignItems::FlexStart, FlexboxConfig::AlignItems::Stretch, FlexboxConfig::JustifyContent::Center, FlexboxConfig::JustifyContent::FlexEnd, FlexboxConfig::JustifyContent::FlexStart, FlexboxConfig::JustifyContent::SpaceAround, FlexboxConfig::JustifyContent::SpaceBetween, FlexboxConfig::JustifyContent::SpaceEvenly, FlexboxConfig::Wrap::NoWrap
|
||||
#include <memory> // for allocator_traits<>::value_type
|
||||
#include <utility> // for swap, move
|
||||
|
||||
#include "ftxui/dom/box_helper.hpp" // for Element, Compute
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApiResolver, TestFactoryImpl
|
||||
#include <memory> // for allocator_traits<>::value_type
|
||||
#include <ftxui/dom/flexbox_config.hpp> // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::Direction::Column, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Direction::Row, FlexboxConfig::Direction::RowInversed
|
||||
#include <memory> // for allocator_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/flexbox_helper.hpp"
|
||||
#include "gtest/gtest_pred_impl.h" // for EXPECT_EQ, Test, TEST
|
||||
|
@@ -434,25 +434,25 @@ TEST(FlexboxTest, GapY) {
|
||||
|
||||
TEST(FlexboxTest, Focus) {
|
||||
auto document = vbox({
|
||||
paragraph("0 -"),
|
||||
paragraph("1 -"),
|
||||
paragraph("2 -"),
|
||||
paragraph("3 -"),
|
||||
paragraph("4 -"),
|
||||
paragraph("5 -"),
|
||||
paragraph("6 -"),
|
||||
paragraph("7 -") | focus,
|
||||
paragraph("8 -"),
|
||||
paragraph("9 -"),
|
||||
}) | yframe | flex;
|
||||
paragraph("0 -"),
|
||||
paragraph("1 -"),
|
||||
paragraph("2 -"),
|
||||
paragraph("3 -"),
|
||||
paragraph("4 -"),
|
||||
paragraph("5 -"),
|
||||
paragraph("6 -"),
|
||||
paragraph("7 -") | focus,
|
||||
paragraph("8 -"),
|
||||
paragraph("9 -"),
|
||||
}) |
|
||||
yframe | flex;
|
||||
|
||||
Screen screen(1, 3);
|
||||
Render(screen, document);
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
"-\r\n"
|
||||
"7\r\n"
|
||||
"-"
|
||||
);
|
||||
"-");
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
@@ -28,7 +28,7 @@ int Integrate(std::vector<int>& elements) {
|
||||
}
|
||||
return accu;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
class GridBox : public Node {
|
||||
public:
|
||||
|
@@ -2,10 +2,11 @@
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for remove
|
||||
#include <string> // for string, allocator, basic_string
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for allocator, basic_string, string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Elements, gridbox, Element, flex, flex_grow, flex_shrink, vtext, vbox, border
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex, Elements, flex_grow, flex_shrink, vtext, gridbox, vbox, focus, operator|=, border, frame
|
||||
#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
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include <utility> // for move
|
||||
#include <ftxui/screen/box.hpp> // for Box
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/dom/node.hpp"
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include <memory> // for __shared_ptr_access
|
||||
#include <vector> // for __alloc_traits<>::value_type
|
||||
#include <ftxui/dom/node.hpp> // for Node, Elements
|
||||
#include <memory> // for __shared_ptr_access
|
||||
#include <vector> // for __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/node_decorator.hpp"
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <string> // for allocator
|
||||
#include <gtest/gtest.h> // for Test, AssertionResult, TestInfo (ptr only), EXPECT_TRUE, TEST
|
||||
#include <string> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, text, underlined, Element
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen, Pixel
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_TRUE, TEST
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
Reference in New Issue
Block a user