diff --git a/include/app/Scene.hpp b/include/app/Scene.hpp index bf53c308..5389c931 100644 --- a/include/app/Scene.hpp +++ b/include/app/Scene.hpp @@ -18,7 +18,6 @@ struct Scene : widget::OpaqueWidget { RackWidget* rack; widget::Widget* menuBar; widget::Widget* moduleBrowser; - widget::Widget* tipWindow; widget::Widget* frameRateWidget; double lastAutosaveTime = 0.0; diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index 1f1c70e7..b53df930 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -889,7 +890,7 @@ struct CheckAppUpdateItem : ui::MenuItem { struct TipItem : ui::MenuItem { void onAction(const event::Action& e) override { - APP->scene->tipWindow->show(); + APP->scene->addChild(tipWindowCreate()); } }; diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index b6056be4..c801b3b4 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -46,14 +46,14 @@ Scene::Scene() { moduleBrowser->hide(); addChild(moduleBrowser); - tipWindow = tipWindowCreate(); - tipWindow->setVisible(settings::showTipsOnLaunch); - addChild(tipWindow); - - frameRateWidget = new FrameRateWidget; - frameRateWidget->box.size = math::Vec(80.0, 30.0); - frameRateWidget->hide(); - addChild(frameRateWidget); + if (settings::showTipsOnLaunch) { + addChild(tipWindowCreate()); + } + + // frameRateWidget = new FrameRateWidget; + // frameRateWidget->box.size = math::Vec(80.0, 30.0); + // frameRateWidget->hide(); + // addChild(frameRateWidget); } Scene::~Scene() { @@ -71,7 +71,7 @@ void Scene::step() { rackScroll->box.pos.y = menuBar->box.size.y; } - frameRateWidget->box.pos.x = box.size.x - frameRateWidget->box.size.x; + // frameRateWidget->box.pos.x = box.size.x - frameRateWidget->box.size.x; // Resize owned descendants menuBar->box.size.x = box.size.x; diff --git a/src/app/TipWindow.cpp b/src/app/TipWindow.cpp index 037123a0..e34ad03c 100644 --- a/src/app/TipWindow.cpp +++ b/src/app/TipWindow.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -15,36 +16,6 @@ namespace rack { namespace app { -struct TipOverlay : widget::OpaqueWidget { - void step() override { - box = parent->box.zeroPos(); - OpaqueWidget::step(); - } - - void onButton(const event::Button& e) override { - OpaqueWidget::onButton(e); - if (e.getTarget() != this) - return; - - if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) { - hide(); - e.consume(this); - } - } - - void onHoverKey(const event::HoverKey& e) override { - OpaqueWidget::onHoverKey(e); - if (e.isConsumed()) - return; - - if (e.action == GLFW_PRESS && e.key == GLFW_KEY_ESCAPE) { - hide(); - e.consume(this); - } - } -}; - - struct UrlButton : ui::Button { std::string url; void onAction(const event::Action& e) override { @@ -162,7 +133,7 @@ struct TipWindow : widget::OpaqueWidget { struct CloseButton : ui::Button { TipWindow* tipWindow; void onAction(const event::Action& e) override { - tipWindow->getParent()->hide(); + tipWindow->getParent()->requestDelete(); } }; CloseButton* closeButton = new CloseButton; @@ -198,16 +169,11 @@ struct TipWindow : widget::OpaqueWidget { bndMenuBackground(args.vg, 0.0, 0.0, box.size.x, box.size.y, 0); Widget::draw(args); } - - void onShow(const event::Show& e) override { - advanceTip(); - OpaqueWidget::onShow(e); - } }; widget::Widget* tipWindowCreate() { - TipOverlay* overlay = new TipOverlay; + ui::MenuOverlay* overlay = new ui::MenuOverlay; TipWindow* tipWindow = new TipWindow; overlay->addChild(tipWindow);