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.

46 lines
978B

  1. #pragma once
  2. #include <common.hpp>
  3. #include <widget/Widget.hpp>
  4. #include <widget/FramebufferWidget.hpp>
  5. #include <widget/SvgWidget.hpp>
  6. #include <settings.hpp>
  7. namespace rack {
  8. namespace app {
  9. /** If you don't add these to your ModuleWidget, they will fall out of the rack... */
  10. struct SvgScrew : widget::Widget {
  11. widget::FramebufferWidget* fb;
  12. widget::SvgWidget* sw;
  13. SvgScrew();
  14. void setSvg(std::shared_ptr<window::Svg> svg);
  15. };
  16. DEPRECATED typedef SvgScrew SVGScrew;
  17. struct ThemedSvgScrew : SvgScrew {
  18. std::shared_ptr<window::Svg> lightSvg;
  19. std::shared_ptr<window::Svg> darkSvg;
  20. void setSvg(std::shared_ptr<window::Svg> lightSvg, std::shared_ptr<window::Svg> darkSvg) {
  21. this->lightSvg = lightSvg;
  22. this->darkSvg = darkSvg;
  23. SvgScrew::setSvg(settings::preferDarkPanels ? darkSvg : lightSvg);
  24. }
  25. void step() override {
  26. SvgScrew::setSvg(settings::preferDarkPanels ? darkSvg : lightSvg);
  27. SvgScrew::step();
  28. }
  29. };
  30. } // namespace app
  31. } // namespace rack