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.

31 lines
600B

  1. #pragma once
  2. #include "widget/OpaqueWidget.hpp"
  3. #include "ui/common.hpp"
  4. namespace rack {
  5. namespace ui {
  6. /** Parent must be a ScrollWidget */
  7. struct ScrollBar : widget::OpaqueWidget {
  8. enum Orientation {
  9. VERTICAL,
  10. HORIZONTAL
  11. };
  12. Orientation orientation;
  13. BNDwidgetState state = BND_DEFAULT;
  14. float offset = 0.0;
  15. float size = 0.0;
  16. ScrollBar();
  17. void draw(const DrawArgs &args) override;
  18. void onDragStart(const event::DragStart &e) override;
  19. void onDragMove(const event::DragMove &e) override;
  20. void onDragEnd(const event::DragEnd &e) override;
  21. };
  22. } // namespace ui
  23. } // namespace rack