From a5c5cdd30200a5bd2faa46179f3c7cf64a156949 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 25 Nov 2020 07:34:21 -0500 Subject: [PATCH] Rearrange Library menu items. Change library plugin update period to 15 seconds. --- include/ui/MenuOverlay.hpp | 1 + src/app/MenuBar.cpp | 12 ++++++------ src/library.cpp | 2 +- src/ui/MenuOverlay.cpp | 9 +++++++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/ui/MenuOverlay.hpp b/include/ui/MenuOverlay.hpp index 53b5ec45..c70863cc 100644 --- a/include/ui/MenuOverlay.hpp +++ b/include/ui/MenuOverlay.hpp @@ -9,6 +9,7 @@ namespace ui { /** Deletes itself from parent when clicked */ struct MenuOverlay : widget::OpaqueWidget { + void draw(const DrawArgs& args) override; void step() override; void onButton(const event::Button& e) override; void onHoverKey(const event::HoverKey& e) override; diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index b53df930..d43beb56 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -766,7 +766,7 @@ struct LibraryMenu : ui::Menu { else if (!library::isLoggedIn()) { UrlItem* registerItem = new UrlItem; registerItem->text = "Register VCV account"; - registerItem->url = "https://vcvrack.com/"; + registerItem->url = "https://vcvrack.com/login"; addChild(registerItem); AccountEmailField* emailField = new AccountEmailField; @@ -789,15 +789,15 @@ struct LibraryMenu : ui::Menu { else { loggedIn = true; - UrlItem* manageItem = new UrlItem; - manageItem->text = "Manage plugins"; - manageItem->url = "https://vcvrack.com/plugins.html"; - addChild(manageItem); - LogOutItem* logOutItem = new LogOutItem; logOutItem->text = "Log out"; addChild(logOutItem); + UrlItem* manageItem = new UrlItem; + manageItem->text = "Browse VCV Library"; + manageItem->url = "https://library.vcvrack.com/"; + addChild(manageItem); + SyncUpdatesItem* syncItem = new SyncUpdatesItem; syncItem->text = "Update all"; addChild(syncItem); diff --git a/src/library.cpp b/src/library.cpp index c04897ad..07dadcad 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -30,7 +30,7 @@ static void checkUpdatesLoop() { // Sleep a few seconds, or wake up when destroy() is called std::unique_lock lock(updatesLoopMutex); - auto duration = std::chrono::seconds(60); + auto duration = std::chrono::seconds(15); if (!updatesLoopRunning) break; updatesLoopCv.wait_for(lock, duration, []() {return !updatesLoopRunning;}); diff --git a/src/ui/MenuOverlay.cpp b/src/ui/MenuOverlay.cpp index bc1bf472..f7902683 100644 --- a/src/ui/MenuOverlay.cpp +++ b/src/ui/MenuOverlay.cpp @@ -5,6 +5,15 @@ namespace rack { namespace ui { +void MenuOverlay::draw(const DrawArgs& args) { + // Possible translucent background + // nvgRect(args.vg, 0, 0, VEC_ARGS(box.size)); + // nvgFillColor(args.vg, nvgRGBAf(0, 0, 0, 0.25)); + // nvgFill(args.vg); + + OpaqueWidget::draw(args); +} + void MenuOverlay::step() { // Adopt parent's size box.size = parent->box.size;