mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-22 04:38:09 +08:00
Feature resizable spilt with custom separator (#583)
* Feature: ResizableSplit with custom separator This resolves: https://github.com/ArthurSonzogni/FTXUI/issues/580 Co-authored-by: Pin Loon Lee <pinloon_0428@hotmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <gtest/gtest.h> // for Test, EXPECT_EQ, Message, TestPartResult, TestInfo (ptr only), TEST
|
||||
#include <chrono> // for operator""s, chrono_literals
|
||||
#include <chrono> // for operator""s, chrono_literals
|
||||
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, allocator
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
@@ -7,7 +8,7 @@
|
||||
#include "ftxui/component/animation.hpp" // for Duration, Params
|
||||
#include "ftxui/component/component.hpp" // for Menu
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/component_options.hpp" // for MenuOption, MenuOption::Down, MenuOption::Left, MenuOption::Right, MenuOption::Up
|
||||
#include "ftxui/component/component_options.hpp" // for MenuOption
|
||||
#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp, Event::Return
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
@@ -53,7 +54,7 @@ TEST(MenuTest, DirectionDown) {
|
||||
auto menu = Menu(&entries, &selected, &option);
|
||||
|
||||
selected = 0;
|
||||
option.direction = MenuOption::Down;
|
||||
option.direction = Direction::Down;
|
||||
Screen screen(4, 3);
|
||||
Render(screen, menu->Render());
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
@@ -80,7 +81,7 @@ TEST(MenuTest, DirectionsUp) {
|
||||
std::vector<std::string> entries = {"1", "2", "3"};
|
||||
MenuOption option;
|
||||
auto menu = Menu(&entries, &selected, &option);
|
||||
option.direction = MenuOption::Up;
|
||||
option.direction = Direction::Up;
|
||||
Screen screen(4, 3);
|
||||
Render(screen, menu->Render());
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
@@ -106,7 +107,7 @@ TEST(MenuTest, DirectionsRight) {
|
||||
std::vector<std::string> entries = {"1", "2", "3"};
|
||||
MenuOption option;
|
||||
auto menu = Menu(&entries, &selected, &option);
|
||||
option.direction = MenuOption::Right;
|
||||
option.direction = Direction::Right;
|
||||
Screen screen(10, 1);
|
||||
Render(screen, menu->Render());
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
@@ -132,7 +133,7 @@ TEST(MenuTest, DirectionsLeft) {
|
||||
std::vector<std::string> entries = {"1", "2", "3"};
|
||||
MenuOption option;
|
||||
auto menu = Menu(&entries, &selected, &option);
|
||||
option.direction = MenuOption::Left;
|
||||
option.direction = Direction::Left;
|
||||
Screen screen(10, 1);
|
||||
Render(screen, menu->Render());
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
|
Reference in New Issue
Block a user