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.

35 lines
643B

  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 box bounds. */
  20. math::Vec margin;
  21. /** Space between adjacent elements. */
  22. math::Vec spacing;
  23. void step() override;
  24. };
  25. } // namespace ui
  26. } // namespace rack