54 childs.push_back({weight, view});
71 void draw(mxgui::DrawingContext& dc)
override
75 for (
auto view : childs)
76 view.drawable->draw(dc);
81 std::vector<View*> out;
82 out.reserve(childs.size());
84 out.push_back(v.drawable);
89 void updateChildBounds()
93 short int avalHeight =
98 for (
auto view : childs)
102 viewBounds.size.height =
103 avalHeight / weigthSum * view.vertWeight;
106 view.drawable->setBounds(viewBounds);
108 y += viewBounds.size.height + spacing;
121 std::vector<Child> childs;
Positions the childs in a vertical grid. The height of each child is dictated by its weight parameter...
VerticalLayout(short int spacing=0)
Creates a new VerticalLayout.
void draw(mxgui::DrawingContext &dc) override
Draw the view in its bounds.
void setBounds(Bounds bounds) override
Sets the bounds in which the view will be drawn.
virtual std::vector< View * > getChilds() override
Returns the list of childs.
void addView(View *view, float weight)
Adds a view to the layout.
Base class for anything that can be drawn on the screen and interacted with.
virtual void draw(mxgui::DrawingContext &dc)
Draw the view in its bounds.
void invalidate()
Signal that what has been previously drawn is now invalid and has to be redrawn.
virtual void setBounds(Bounds bounds)
Sets the bounds in which the view will be drawn.
This file includes all the types the logdecoder script will decode.