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.

WindowWidget.hpp 454B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "widgets/OpaqueWidget.hpp"
  3. #include "ui/common.hpp"
  4. namespace rack {
  5. struct WindowWidget : OpaqueWidget {
  6. std::string title;
  7. void draw(NVGcontext *vg) override {
  8. bndNodeBackground(vg, 0.0, 0.0, box.size.x, box.size.y, BND_DEFAULT, -1, title.c_str(), bndGetTheme()->backgroundColor);
  9. Widget::draw(vg);
  10. }
  11. void onDragMove(event::DragMove &e) override {
  12. box.pos = box.pos.plus(e.mouseDelta);
  13. }
  14. };
  15. } // namespace rack