| 12 | |
| 13 | |
| 14 | void Button::draw(const DrawArgs& args) { |
| 15 | BNDwidgetState state = BND_DEFAULT; |
| 16 | if (APP->event->getHoveredWidget() == this) |
| 17 | state = BND_HOVER; |
| 18 | if (APP->event->getDraggedWidget() == this) |
| 19 | state = BND_ACTIVE; |
| 20 | |
| 21 | std::string text = this->text; |
| 22 | if (text.empty() && quantity) |
| 23 | text = quantity->getLabel(); |
| 24 | bndToolButton(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_NONE, state, -1, text.c_str()); |
| 25 | } |
| 26 | |
| 27 | |
| 28 | void Button::onDragStart(const DragStartEvent& e) { |
nothing calls this directly
no test coverage detected