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.

47 lines
1.0KB

  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/Widget.hpp>
  4. #include <widget/OpaqueWidget.hpp>
  5. #include <ui/TextField.hpp>
  6. namespace rack {
  7. namespace app {
  8. struct LedDisplay : widget::Widget {
  9. void draw(const DrawArgs& args) override;
  10. };
  11. struct LedDisplaySeparator : widget::Widget {
  12. LedDisplaySeparator();
  13. void draw(const DrawArgs& args) override;
  14. };
  15. struct LedDisplayChoice : widget::OpaqueWidget {
  16. std::string text;
  17. std::string fontPath;
  18. math::Vec textOffset;
  19. NVGcolor color;
  20. NVGcolor bgColor;
  21. LedDisplayChoice();
  22. void draw(const DrawArgs& args) override;
  23. void drawLayer(const DrawArgs& args, int layer) override;
  24. void onButton(const ButtonEvent& e) override;
  25. };
  26. struct LedDisplayTextField : ui::TextField {
  27. std::string fontPath;
  28. math::Vec textOffset;
  29. NVGcolor color;
  30. NVGcolor bgColor;
  31. LedDisplayTextField();
  32. void draw(const DrawArgs& args) override;
  33. void drawLayer(const DrawArgs& args, int layer) override;
  34. int getTextPosition(math::Vec mousePos) override;
  35. };
  36. } // namespace app
  37. } // namespace rack