dbox.cpp
algorithm
cstddef
memory
utility
vector
ftxui/dom/elements.hpp
ftxui/dom/node.hpp
ftxui/dom/requirement.hpp
ftxui/screen/box.hpp
ftxui/screen/pixel.hpp
ftxui/dom/canvas.hpp
ftxui/dom/deprecated.hpp
ftxui/dom/direction.hpp
ftxui/dom/elements.hpp
ftxui/dom/flexbox_config.hpp
ftxui/dom/linear_gradient.hpp
ftxui/dom/node.hpp
ftxui/dom/requirement.hpp
ftxui/dom/selection.hpp
ftxui/screen/box.hpp
ftxui/screen/color.hpp
ftxui/screen/image.hpp
ftxui/screen/pixel.hpp
ftxui/screen/screen.hpp
ftxui/screen/string.hpp
ftxui/screen/terminal.hpp
ftxui/util/autoreset.hpp
ftxui/util/ref.hpp
src/ftxui/dom/dbox.cpp
algorithm
cstddef
cstdint
ftxui/dom/take_any_args.hpp
functional
memory
optional
sstream
string
unordered_map
utility
variant
vector
ftxui

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<algorithm>//formax
    #include<cstddef>//forsize_t
    #include<memory>//for__shared_ptr_access,shared_ptr,make_shared
    #include<utility>//formove
    #include<vector>

    #include"ftxui/dom/elements.hpp"//forElement,Elements,dbox
    #include"ftxui/dom/node.hpp"//forNode,Elements
    #include"ftxui/dom/requirement.hpp"//forRequirement
    #include"ftxui/screen/box.hpp"//forBox
    #include"ftxui/screen/pixel.hpp"//forPixel

    namespaceftxui{

    namespace{
    classDBox:publicNode{
    public:
    explicitDBox(Elementschildren):Node(std::move(children)){}

    voidComputeRequirement()override{
    requirement_=Requirement{};
    for(auto&child:children_){
    child->ComputeRequirement();

    //Propagatethefocusedrequirement.
    if(requirement_.focused.Prefer(child->requirement().focused)){
    requirement_.focused=child->requirement().focused;
    }

    //Extendthemin_xandmin_ytocontainallthechildren
    requirement_.min_x=
    std::max(requirement_.min_x,child->requirement().min_x);
    requirement_.min_y=
    std::max(requirement_.min_y,child->requirement().min_y);
    }
    }

    voidSetBox(Boxbox)override{
    Node::SetBox(box);

    for(auto&child:children_){
    child->SetBox(box);
    }
    }
    };
    }//namespace

    ///@briefStackseveralelementontopofeachother.
    ///@paramchildren_Theinputelement.
    ///@returnTherightalignedelement.
    ///@ingroupdom
    Elementdbox(Elementschildren_){
    returnstd::make_shared<DBox>(std::move(children_));
    }

    }//namespaceftxui