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.

22 lines
431B

  1. #pragma once
  2. #include "ui/common.hpp"
  3. #include "ui/QuantityWidget.hpp"
  4. namespace rack {
  5. struct ProgressBar : QuantityWidget {
  6. ProgressBar() {
  7. box.size.y = BND_WIDGET_HEIGHT;
  8. }
  9. void draw(NVGcontext *vg) override {
  10. float progress = rescale(value, minValue, maxValue, 0.0, 1.0);
  11. bndSlider(vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_ALL, BND_DEFAULT, progress, getText().c_str(), NULL);
  12. }
  13. };
  14. } // namespace rack