mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-11-04 13:38:14 +08:00 
			
		
		
		
	Implement flexbox (#277)
This implement the flexbox elements, following the HTML one. Built from them, there is also the following elements: - `paragraph` - `paragraphAlignLeft` - `paragraphAlignRight` - `paragraphAlignCenter` - `paragraphAlignJustify` This is a breaking change.
This commit is contained in:
		@@ -1,11 +1,12 @@
 | 
			
		||||
#include <stddef.h>                // for size_t
 | 
			
		||||
#include <stdio.h>                 // for getchar
 | 
			
		||||
#include <ftxui/dom/elements.hpp>  // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
 | 
			
		||||
#include <ftxui/screen/screen.hpp>  // for Full, Screen
 | 
			
		||||
#include <memory>                   // for allocator, shared_ptr
 | 
			
		||||
#include <string>  // for operator+, to_string, char_traits, string
 | 
			
		||||
 | 
			
		||||
#include "ftxui/dom/node.hpp"    // for Render
 | 
			
		||||
#include "ftxui/screen/box.hpp"  // for ftxui
 | 
			
		||||
#include "ftxui/dom/flexbox_config.hpp"  // for ftxui
 | 
			
		||||
#include "ftxui/dom/node.hpp"            // for Render
 | 
			
		||||
 | 
			
		||||
int main(int argc, const char* argv[]) {
 | 
			
		||||
  using namespace ftxui;
 | 
			
		||||
@@ -44,6 +45,7 @@ int main(int argc, const char* argv[]) {
 | 
			
		||||
  auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
 | 
			
		||||
  Render(screen, document);
 | 
			
		||||
  screen.Print();
 | 
			
		||||
  getchar();
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user