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.

25 lines
548B

  1. #include <ui/ChoiceButton.hpp>
  2. #include <context.hpp>
  3. namespace rack {
  4. namespace ui {
  5. void ChoiceButton::draw(const DrawArgs& args) {
  6. BNDwidgetState state = BND_DEFAULT;
  7. if (APP->event->getHoveredWidget() == this)
  8. state = BND_HOVER;
  9. if (APP->event->getDraggedWidget() == this)
  10. state = BND_ACTIVE;
  11. std::string text = this->text;
  12. if (text.empty() && quantity)
  13. text = quantity->getLabel();
  14. bndChoiceButton(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_NONE, state, -1, text.c_str());
  15. }
  16. } // namespace ui
  17. } // namespace rack