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.

24 lines
618B

  1. #pragma once
  2. #include "app/common.hpp"
  3. namespace rack {
  4. /** A Component with a default (up) and active (down) state when clicked.
  5. Does not modify a Param, simply calls onAction() of a subclass.
  6. */
  7. struct SVGButton : FramebufferWidget {
  8. std::shared_ptr<SVG> defaultSVG;
  9. std::shared_ptr<SVG> activeSVG;
  10. SVGWidget *sw;
  11. SVGButton();
  12. /** If `activeSVG` is NULL, `defaultSVG` is used as the active state instead. */
  13. void setSVGs(std::shared_ptr<SVG> defaultSVG, std::shared_ptr<SVG> activeSVG);
  14. void onDragStart(event::DragStart &e) override;
  15. void onDragEnd(event::DragEnd &e) override;
  16. };
  17. } // namespace rack