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.

33 lines
589B

  1. #pragma once
  2. #include "widget/Widget.hpp"
  3. #include "ui/common.hpp"
  4. namespace rack {
  5. namespace ui {
  6. /** Positions children in a row/column based on their widths/heights */
  7. struct SequentialLayout : widget::Widget {
  8. enum Orientation {
  9. HORIZONTAL_ORIENTATION,
  10. VERTICAL_ORIENTATION,
  11. };
  12. enum Alignment {
  13. LEFT_ALIGNMENT,
  14. CENTER_ALIGNMENT,
  15. RIGHT_ALIGNMENT,
  16. };
  17. Orientation orientation = HORIZONTAL_ORIENTATION;
  18. Alignment alignment = LEFT_ALIGNMENT;
  19. /** Space between adjacent elements */
  20. math::Vec spacing;
  21. void step() override;
  22. };
  23. } // namespace ui
  24. } // namespace rack