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
434B

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