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.

21 lines
395B

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