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.

25 lines
647B

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