You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
461B

  1. #include <ui/List.hpp>
  2. namespace rack {
  3. namespace ui {
  4. void List::step() {
  5. Widget::step();
  6. // Set positions of children
  7. box.size.y = 0.0;
  8. for (widget::Widget* child : children) {
  9. if (!child->visible)
  10. continue;
  11. // Set position of child
  12. child->box.pos = math::Vec(0.0, box.size.y);
  13. // Increment height
  14. box.size.y += child->box.size.y;
  15. // Resize width of child
  16. child->box.size.x = box.size.x;
  17. }
  18. }
  19. } // namespace ui
  20. } // namespace rack