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.

27 lines
544B

  1. #pragma once
  2. #include "ui/common.hpp"
  3. #include "widgets/OpaqueWidget.hpp"
  4. #include "ui/ScrollBar.hpp"
  5. namespace rack {
  6. /** Handles a container with ScrollBar */
  7. struct ScrollWidget : OpaqueWidget {
  8. Widget *container;
  9. ScrollBar *horizontalScrollBar;
  10. ScrollBar *verticalScrollBar;
  11. math::Vec offset;
  12. ScrollWidget();
  13. void scrollTo(math::Rect r);
  14. void draw(NVGcontext *vg) override;
  15. void step() override;
  16. void onHover(const event::Hover &e) override;
  17. void onHoverScroll(const event::HoverScroll &e) override;
  18. };
  19. } // namespace rack