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.

30 lines
563B

  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. float offset = 0.0;
  14. float size = 0.0;
  15. ScrollBar();
  16. void draw(const DrawArgs& args) override;
  17. void onDragStart(const event::DragStart& e) override;
  18. void onDragMove(const event::DragMove& e) override;
  19. void onDragEnd(const event::DragEnd& e) override;
  20. };
  21. } // namespace ui
  22. } // namespace rack