68class Flex :
public Node {
72 void ComputeRequirement()
override {
73 requirement_.min_x = 0;
74 requirement_.min_y = 0;
75 if (!children_.empty()) {
76 children_[0]->ComputeRequirement();
77 requirement_ = children_[0]->requirement();
82 void SetBox(Box
box)
override {
84 if (children_.empty()) {
87 children_[0]->SetBox(
box);
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Element xflex_grow(Element)
Expand if possible on the X axis.
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
std::shared_ptr< Node > Element
std::shared_ptr< T > Make(Args &&... args)
Element yflex(Element)
Expand/Minimize if possible/needed on the Y axis.
Element flex_shrink(Element)
Minimize if needed.
Element yflex_grow(Element)
Expand if possible on the Y axis.
Element flex_grow(Element)
Expand if possible.
Element notflex(Element)
Make the element not flexible.
Element xflex_shrink(Element)
Minimize if needed on the X axis.
Element filler()
An element that will take expand proportionally to the space left in a container.
Element yflex_shrink(Element)
Minimize if needed on the Y axis.