mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 02:28:11 +08:00 
			
		
		
		
	Run clang-format.
This commit is contained in:
		| @@ -10,7 +10,6 @@ | ||||
| #include "ftxui/component/toggle.hpp" | ||||
| #include "ftxui/screen/string.hpp" | ||||
|  | ||||
|  | ||||
| using namespace ftxui; | ||||
|  | ||||
| int shift = 0; | ||||
|   | ||||
| @@ -9,55 +9,50 @@ | ||||
| using namespace ftxui; | ||||
|  | ||||
| class MyComponent : public Component { | ||||
|   public: | ||||
|    MyComponent() { | ||||
|      Add(&container_); | ||||
|      container_.Add(&menu_); | ||||
|  public: | ||||
|   MyComponent() { | ||||
|     Add(&container_); | ||||
|     container_.Add(&menu_); | ||||
|  | ||||
|      menu_.entries = { | ||||
|        L"menu_1", | ||||
|        L"menu_2", | ||||
|        L"menu_3", | ||||
|      }; | ||||
|     menu_.entries = { | ||||
|         L"menu_1", | ||||
|         L"menu_2", | ||||
|         L"menu_3", | ||||
|     }; | ||||
|  | ||||
|      container_.Add(&tab_container_); | ||||
|      | ||||
|      menu_1_.entries = { | ||||
|        L"Forest", | ||||
|        L"Water", | ||||
|        L"I don't know" | ||||
|      }; | ||||
|      tab_container_.Add(&menu_1_); | ||||
|     container_.Add(&tab_container_); | ||||
|  | ||||
|      menu_2_.entries = { | ||||
|        L"Hello", | ||||
|        L"Hi", | ||||
|        L"Hay", | ||||
|      }; | ||||
|      tab_container_.Add(&menu_2_); | ||||
|     menu_1_.entries = {L"Forest", L"Water", L"I don't know"}; | ||||
|     tab_container_.Add(&menu_1_); | ||||
|  | ||||
|      menu_3_.entries = { | ||||
|        L"Table", | ||||
|        L"Nothing", | ||||
|        L"Is", | ||||
|        L"Empty", | ||||
|      }; | ||||
|      tab_container_.Add(&menu_3_); | ||||
|    } | ||||
|     menu_2_.entries = { | ||||
|         L"Hello", | ||||
|         L"Hi", | ||||
|         L"Hay", | ||||
|     }; | ||||
|     tab_container_.Add(&menu_2_); | ||||
|  | ||||
|    std::function<void()> on_enter = [](){}; | ||||
|   private: | ||||
|    Menu menu_; | ||||
|    Container container_ = Container::Horizontal(); | ||||
|    Container tab_container_ = Container::Tab(&(menu_.selected)); | ||||
|    Menu menu_1_; | ||||
|    Menu menu_2_; | ||||
|    Menu menu_3_; | ||||
|     menu_3_.entries = { | ||||
|         L"Table", | ||||
|         L"Nothing", | ||||
|         L"Is", | ||||
|         L"Empty", | ||||
|     }; | ||||
|     tab_container_.Add(&menu_3_); | ||||
|   } | ||||
|  | ||||
|   std::function<void()> on_enter = []() {}; | ||||
|  | ||||
|  private: | ||||
|   Menu menu_; | ||||
|   Container container_ = Container::Horizontal(); | ||||
|   Container tab_container_ = Container::Tab(&(menu_.selected)); | ||||
|   Menu menu_1_; | ||||
|   Menu menu_2_; | ||||
|   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,21 +2,20 @@ | ||||
| #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; | ||||
|  | ||||
|   std::string reset_position; | ||||
|   for(int index = 0; index < 200; ++index) { | ||||
|   for (int index = 0; index < 200; ++index) { | ||||
|     std::vector<Element> entries; | ||||
|     for(int i = 0; i<22; ++i) { | ||||
|     for (int i = 0; i < 22; ++i) { | ||||
|       if (i != 0) | ||||
|       entries.push_back(separator()); | ||||
|         entries.push_back(separator()); | ||||
|       // clang-format off | ||||
|       entries.push_back( | ||||
|         hbox( | ||||
|   | ||||
| @@ -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 = | ||||
|   | ||||
| @@ -16,14 +16,14 @@ class DrawKey : public Component { | ||||
|     Elements children; | ||||
|     for (size_t i = std::max(0, (int)keys.size() - 10); i < keys.size(); ++i) { | ||||
|       std::wstring code; | ||||
|       for(auto& it : keys[i].input()) | ||||
|       for (auto& it : keys[i].input()) | ||||
|         code += L" " + std::to_wstring((unsigned int)it); | ||||
|  | ||||
|       code = L"(" + code + L" ) -> "; | ||||
|       if (keys[i].is_character()) | ||||
|         code +=  keys[i].character(); | ||||
|         code += keys[i].character(); | ||||
|       else | ||||
|         code +=  L"(special)"; | ||||
|         code += L"(special)"; | ||||
|       children.push_back(text(code)); | ||||
|     } | ||||
|     return vbox(std::move(children)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ArthurSonzogni
					ArthurSonzogni