From d197e2f4fbee92fa3e918ad59d525a7c7b6362a2 Mon Sep 17 00:00:00 2001 From: Arthur Sonzogni Date: Sat, 7 Aug 2021 22:30:55 +0200 Subject: [PATCH] Switch to rounded borders. (#175) They are nicer. It would be nice supporting a way for FTXUI to let the user chose what they prefer instead. --- src/ftxui/dom/border.cpp | 7 ++++++- src/ftxui/dom/text_test.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ftxui/dom/border.cpp b/src/ftxui/dom/border.cpp index 5847511..dcbe695 100644 --- a/src/ftxui/dom/border.cpp +++ b/src/ftxui/dom/border.cpp @@ -12,7 +12,12 @@ namespace ftxui { -static wchar_t simple_border_charset[] = L"┌┐└┘─│┬┴┤├"; +static wchar_t simple_border_charset[] = L"╭╮╰╯─│┬┴┤├"; + +// For reference, here is the charset for normal border: +// L"┌┐└┘─│┬┴┤├"; +// TODO(arthursonzogni): Consider adding options to choose the kind of borders +// to use. class Border : public Node { public: diff --git a/src/ftxui/dom/text_test.cpp b/src/ftxui/dom/text_test.cpp index dc43393..ad1b430 100644 --- a/src/ftxui/dom/text_test.cpp +++ b/src/ftxui/dom/text_test.cpp @@ -57,9 +57,9 @@ TEST(TextTest, CJK) { Screen screen(6, 3); Render(screen, element); EXPECT_EQ( - "┌────┐\r\n" + "╭────╮\r\n" "│测试│\r\n" - "└────┘", + "╰────╯", screen.ToString()); } @@ -69,9 +69,9 @@ TEST(TextTest, CJK_2) { Screen screen(5, 3); Render(screen, element); EXPECT_EQ( - "┌───┐\r\n" + "╭───╮\r\n" "│测试\r\n" - "└───┘", + "╰───╯", screen.ToString()); } @@ -81,9 +81,9 @@ TEST(TextTest, CJK_3) { Screen screen(4, 3); Render(screen, element); EXPECT_EQ( - "┌──┐\r\n" + "╭──╮\r\n" "│测│\r\n" - "└──┘", + "╰──╯", screen.ToString()); }