11Elements Split(std::string the_text) {
13 std::stringstream ss(the_text);
15 while (std::getline(ss, word,
' '))
16 output.push_back(
text(word));
34 return flexbox(Split(std::move(the_text)), config);
42 static const auto config =
44 return flexbox(Split(std::move(the_text)), config);
52 static const auto config =
54 return flexbox(Split(std::move(the_text)), config);
65 Elements words = Split(std::move(the_text));
67 return flexbox(std::move(words), config);
Element paragraphAlignCenter(std::string text)
Return an element drawing the paragraph on multiple lines, aligned on the center.
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
std::shared_ptr< Node > Element
Element paragraphAlignJustify(std::string text)
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
Element paragraphAlignRight(std::string text)
Return an element drawing the paragraph on multiple lines, aligned on the right.
std::vector< Element > Elements
Element text(std::wstring text)
Display a piece of unicode text.
Elements paragraph(std::wstring text)
Element paragraphAlignLeft(std::string text)
Return an element drawing the paragraph on multiple lines, aligned on the left.
FlexboxConfig & SetGap(int gap_x, int gap_y)
@ Center
Items are centered along the line.
@ FlexEnd
Items are aligned to the end of flexbox's direction.
@ SpaceBetween
Items are evenly distributed in the line; first item is on the start.
FlexboxConfig & Set(FlexboxConfig::Direction)