| 14 | } |
| 15 | |
| 16 | void Slider::draw(const DrawArgs& args) { |
| 17 | BNDwidgetState state = BND_DEFAULT; |
| 18 | if (APP->event->hoveredWidget == this) |
| 19 | state = BND_HOVER; |
| 20 | if (APP->event->draggedWidget == this) |
| 21 | state = BND_ACTIVE; |
| 22 | |
| 23 | float progress = quantity ? quantity->getScaledValue() : 0.f; |
| 24 | std::string text = quantity ? quantity->getString() : ""; |
| 25 | |
| 26 | // If parent is a Menu, make corners sharp |
| 27 | ui::Menu* parentMenu = dynamic_cast<ui::Menu*>(getParent()); |
| 28 | int flags = parentMenu ? BND_CORNER_ALL : BND_CORNER_NONE; |
| 29 | bndSlider(args.vg, 0.0, 0.0, box.size.x, box.size.y, flags, state, progress, text.c_str(), NULL); |
| 30 | } |
| 31 | |
| 32 | void Slider::onDragStart(const DragStartEvent& e) { |
| 33 | if (e.button != GLFW_MOUSE_BUTTON_LEFT) |
nothing calls this directly
no test coverage detected