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.

19 lines
512B

  1. #include "widgets.hpp"
  2. #include "gui.hpp"
  3. namespace rack {
  4. void MenuEntry::step() {
  5. // Add 10 more pixels because Retina measurements are sometimes too small
  6. const float rightPadding = 10.0;
  7. // HACK use gVg from the gui.
  8. // All this does is inspect the font, so it shouldn't modify gVg and should work when called from a FramebufferWidget for example.
  9. box.size.x = bndLabelWidth(gVg, -1, text.c_str()) + bndLabelWidth(gVg, -1, rightText.c_str()) + rightPadding;
  10. Widget::step();
  11. }
  12. } // namespace rack