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.

33 lines
452B

  1. #pragma once
  2. #include "ui/common.hpp"
  3. #include "ui/Button.hpp"
  4. namespace rack {
  5. struct IconButton : Button {
  6. FramebufferWidget *fw;
  7. SVGWidget *sw;
  8. IconButton() {
  9. box.size.x = BND_TOOL_WIDTH;
  10. fw = new FramebufferWidget;
  11. fw->oversample = 2;
  12. addChild(fw);
  13. sw = new SVGWidget;
  14. sw->box.pos = Vec(2, 2);
  15. fw->addChild(sw);
  16. }
  17. void setSVG(std::shared_ptr<SVG> svg) {
  18. sw->setSVG(svg);
  19. fw->dirty = true;
  20. }
  21. };
  22. } // namespace rack