Browse Source

ModuleBrowser moves to mouse position

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
0d17c1c837
3 changed files with 7 additions and 1 deletions
  1. +1
    -0
      include/ui.hpp
  2. +2
    -1
      src/app/ModuleBrowser.cpp
  3. +4
    -0
      src/ui/ScrollWidget.cpp

+ 1
- 0
include/ui.hpp View File

@@ -188,6 +188,7 @@ struct ScrollWidget : OpaqueWidget {
void step() override;
void onMouseMove(EventMouseMove &e) override;
void onScroll(EventScroll &e) override;
void onHoverKey(EventHoverKey &e) override;
};

struct TextField : OpaqueWidget {


+ 2
- 1
src/app/ModuleBrowser.cpp View File

@@ -413,7 +413,6 @@ struct ModuleBrowser : OpaqueWidget {
}

void step() override {
box.pos = parent->box.size.minus(box.size).div(2).round();
box.pos.y = 60;
box.size.y = parent->box.size.y - 2 * box.pos.y;

@@ -516,6 +515,8 @@ void appModuleBrowserCreate() {

ModuleBrowser *moduleBrowser = new ModuleBrowser();
overlay->addChild(moduleBrowser);
moduleBrowser->box.pos = gMousePos.minus(moduleBrowser->box.getCenter());

gScene->setOverlay(overlay);
}



+ 4
- 0
src/ui/ScrollWidget.cpp View File

@@ -140,5 +140,9 @@ void ScrollWidget::onScroll(EventScroll &e) {
e.consumed = true;
}

void ScrollWidget::onHoverKey(EventHoverKey &e) {
Widget::onHoverKey(e);
}


} // namespace rack

Loading…
Cancel
Save