mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 04:31:34 +08:00
Run clang-format.
This commit is contained in:
parent
1703552235
commit
fce29a03b3
@ -10,7 +10,6 @@
|
||||
#include "ftxui/component/toggle.hpp"
|
||||
#include "ftxui/screen/string.hpp"
|
||||
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
int shift = 0;
|
||||
|
@ -22,11 +22,7 @@ class MyComponent : public Component {
|
||||
|
||||
container_.Add(&tab_container_);
|
||||
|
||||
menu_1_.entries = {
|
||||
L"Forest",
|
||||
L"Water",
|
||||
L"I don't know"
|
||||
};
|
||||
menu_1_.entries = {L"Forest", L"Water", L"I don't know"};
|
||||
tab_container_.Add(&menu_1_);
|
||||
|
||||
menu_2_.entries = {
|
||||
@ -46,6 +42,7 @@ class MyComponent : public Component {
|
||||
}
|
||||
|
||||
std::function<void()> on_enter = []() {};
|
||||
|
||||
private:
|
||||
Menu menu_;
|
||||
Container container_ = Container::Horizontal();
|
||||
@ -55,9 +52,7 @@ class MyComponent : public Component {
|
||||
Menu menu_3_;
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int main(int argc, const char* argv[]) {
|
||||
auto screen = ScreenInteractive::TerminalOutput();
|
||||
MyComponent component;
|
||||
component.on_enter = screen.ExitLoopClosure();
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
using namespace std::chrono_literals;
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/screen/string.hpp"
|
||||
|
||||
|
||||
class Graph {
|
||||
public:
|
||||
std::vector<int> operator()(int width, int height) {
|
||||
|
@ -2,12 +2,11 @@
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/screen/string.hpp"
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
// clang-format off
|
||||
auto document =
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
// clang-format off
|
||||
auto document =
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
// clang-format off
|
||||
auto document =
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
// clang-format off
|
||||
auto document =
|
||||
|
@ -1,10 +1,9 @@
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
// clang-format off
|
||||
auto document =
|
||||
|
@ -1,11 +1,10 @@
|
||||
#ifndef FTXUI_COMPONENT_RECEIVER_HPP_
|
||||
#define FTXUI_COMPONENT_RECEIVER_HPP_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
|
@ -75,5 +75,4 @@ TEST(RadioboxTest, Navigation) {
|
||||
radiobox.OnEvent(Event::TabReverse);
|
||||
EXPECT_EQ(radiobox.focused, 1);
|
||||
radiobox.OnEvent(Event::TabReverse);
|
||||
|
||||
}
|
||||
|
@ -58,10 +58,14 @@ TEST(Receiver, BasicWithThread) {
|
||||
s1_bis.reset();
|
||||
|
||||
char c;
|
||||
EXPECT_TRUE(r3->Receive(&c));EXPECT_EQ(c, '1');
|
||||
EXPECT_TRUE(r3->Receive(&c)); EXPECT_EQ(c, '2');
|
||||
EXPECT_TRUE(r3->Receive(&c)); EXPECT_EQ(c, '3');
|
||||
EXPECT_TRUE(r3->Receive(&c)); EXPECT_EQ(c, '4');
|
||||
EXPECT_TRUE(r3->Receive(&c));
|
||||
EXPECT_EQ(c, '1');
|
||||
EXPECT_TRUE(r3->Receive(&c));
|
||||
EXPECT_EQ(c, '2');
|
||||
EXPECT_TRUE(r3->Receive(&c));
|
||||
EXPECT_EQ(c, '3');
|
||||
EXPECT_TRUE(r3->Receive(&c));
|
||||
EXPECT_EQ(c, '4');
|
||||
EXPECT_FALSE(r3->Receive(&c));
|
||||
|
||||
// Thread will end at the end of the stream.
|
||||
|
@ -70,5 +70,4 @@ TEST(ToggleTest, Tab) {
|
||||
toggle.OnEvent(Event::TabReverse);
|
||||
EXPECT_EQ(toggle.selected, 1);
|
||||
toggle.OnEvent(Event::TabReverse);
|
||||
|
||||
}
|
||||
|
@ -6,10 +6,7 @@ using namespace ftxui;
|
||||
using namespace ftxui;
|
||||
|
||||
TEST(HBoxTest, ScreenSmaller1) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), text(L"text_2"));
|
||||
Screen screen(11, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -17,10 +14,7 @@ TEST(HBoxTest, ScreenSmaller1) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenSmaller2) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), text(L"text_2"));
|
||||
Screen screen(10, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -28,10 +22,7 @@ TEST(HBoxTest, ScreenSmaller2) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenFit) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), text(L"text_2"));
|
||||
Screen screen(12, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -39,20 +30,14 @@ TEST(HBoxTest, ScreenFit) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenBigger1) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), text(L"text_2"));
|
||||
Screen screen(13, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
EXPECT_EQ("text_1text_2 ", screen.ToString());
|
||||
}
|
||||
TEST(HBoxTest, ScreenBigger2) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), text(L"text_2"));
|
||||
Screen screen(14, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -60,11 +45,7 @@ TEST(HBoxTest, ScreenBigger2) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenSmaller1Flex) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
filler(),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), filler(), text(L"text_2"));
|
||||
Screen screen(11, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -72,11 +53,7 @@ TEST(HBoxTest, ScreenSmaller1Flex) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenSmaller2Flex) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
filler(),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), filler(), text(L"text_2"));
|
||||
Screen screen(10, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -84,11 +61,7 @@ TEST(HBoxTest, ScreenSmaller2Flex) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenFitFlex) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
filler(),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), filler(), text(L"text_2"));
|
||||
Screen screen(12, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -96,11 +69,7 @@ TEST(HBoxTest, ScreenFitFlex) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenBigger1Flex) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
filler(),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), filler(), text(L"text_2"));
|
||||
Screen screen(13, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
@ -108,11 +77,7 @@ TEST(HBoxTest, ScreenBigger1Flex) {
|
||||
}
|
||||
|
||||
TEST(HBoxTest, ScreenBigger2Flex) {
|
||||
auto root = hbox(
|
||||
text(L"text_1"),
|
||||
filler(),
|
||||
text(L"text_2")
|
||||
);
|
||||
auto root = hbox(text(L"text_1"), filler(), text(L"text_2"));
|
||||
Screen screen(14, 1);
|
||||
Render(screen, root.get());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/dom/node.hpp"
|
||||
|
@ -54,8 +54,8 @@ TEST(VBoxTest, ScreenFitFlex) {
|
||||
" \n"
|
||||
" \n"
|
||||
" \n"
|
||||
"text_2 "
|
||||
,screen.ToString());
|
||||
"text_2 ",
|
||||
screen.ToString());
|
||||
}
|
||||
|
||||
TEST(VBoxTest, ScreenBigger1Flex) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "ftxui/screen/string.hpp"
|
||||
#include "ftxui/screen/terminal.hpp"
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4996) // codecvt_utf8_utf16 is deprecated
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
|
Loading…
Reference in New Issue
Block a user