Browse Source

Rearrange Library menu items. Change library plugin update period to 15 seconds.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
a5c5cdd302
4 changed files with 17 additions and 7 deletions
  1. +1
    -0
      include/ui/MenuOverlay.hpp
  2. +6
    -6
      src/app/MenuBar.cpp
  3. +1
    -1
      src/library.cpp
  4. +9
    -0
      src/ui/MenuOverlay.cpp

+ 1
- 0
include/ui/MenuOverlay.hpp View File

@@ -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;


+ 6
- 6
src/app/MenuBar.cpp View File

@@ -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);


+ 1
- 1
src/library.cpp View File

@@ -30,7 +30,7 @@ static void checkUpdatesLoop() {

// Sleep a few seconds, or wake up when destroy() is called
std::unique_lock<std::mutex> lock(updatesLoopMutex);
auto duration = std::chrono::seconds(60);
auto duration = std::chrono::seconds(15);
if (!updatesLoopRunning)
break;
updatesLoopCv.wait_for(lock, duration, []() {return !updatesLoopRunning;});


+ 9
- 0
src/ui/MenuOverlay.cpp View File

@@ -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;


Loading…
Cancel
Save