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.

24 lines
519B

  1. #include "ui/Tooltip.hpp"
  2. #include "app.hpp"
  3. #include "window.hpp"
  4. namespace rack {
  5. void Tooltip::step() {
  6. // Wrap size to contents
  7. box.size.x = bndLabelWidth(app()->window->vg, -1, text.c_str()) + 10.0;
  8. box.size.y = bndLabelHeight(app()->window->vg, -1, text.c_str(), INFINITY);
  9. Widget::step();
  10. }
  11. void Tooltip::draw(NVGcontext *vg) {
  12. bndTooltipBackground(vg, 0.0, 0.0, box.size.x, box.size.y);
  13. bndMenuLabel(vg, 0.0, 0.0, box.size.x, box.size.y, -1, text.c_str());
  14. Widget::draw(vg);
  15. }
  16. } // namespace rack