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

  1. #include <ui/ProgressBar.hpp>
  2. namespace rack {
  3. namespace ui {
  4. ProgressBar::ProgressBar() {
  5. box.size.y = BND_WIDGET_HEIGHT;
  6. }
  7. void ProgressBar::draw(const DrawArgs& args) {
  8. float progress = quantity ? quantity->getScaledValue() : 0.f;
  9. std::string text = quantity ? quantity->getString() : "";
  10. bndSlider(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_ALL, BND_DEFAULT, progress, text.c_str(), NULL);
  11. }
  12. } // namespace ui
  13. } // namespace rack