Browse Source

Reorder module Info menu items

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
720ca0ed74
1 changed files with 32 additions and 30 deletions
  1. +32
    -30
      src/app/ModuleWidget.cpp

+ 32
- 30
src/app/ModuleWidget.cpp View File

@@ -50,37 +50,39 @@ struct ModuleInfoItem : ui::MenuItem {
ui::Menu* menu = new ui::Menu;

// plugin
ModuleUrlItem* pluginItem = new ModuleUrlItem;
pluginItem->text = "Plugin: " + model->plugin->name;;
if (model->plugin->pluginUrl != "") {
ModuleUrlItem* pluginItem = new ModuleUrlItem;
pluginItem->text = model->plugin->name;
pluginItem->url = model->plugin->pluginUrl;
menu->addChild(pluginItem);
}
else {
ui::MenuLabel* pluginLabel = new ui::MenuLabel;
pluginLabel->text = model->plugin->name;
menu->addChild(pluginLabel);
pluginItem->disabled = true;
}
menu->addChild(pluginItem);

ui::MenuLabel* versionLabel = new ui::MenuLabel;
versionLabel->text = "v" + model->plugin->version;
menu->addChild(versionLabel);

// author
if (model->plugin->author != "") {
ModuleUrlItem* authorItem = new ModuleUrlItem;
authorItem->text = "Author: " + model->plugin->author;
if (model->plugin->authorUrl != "") {
ModuleUrlItem* authorItem = new ModuleUrlItem;
authorItem->text = "by " + model->plugin->author;
authorItem->url = model->plugin->authorUrl;
menu->addChild(authorItem);
}
else {
ui::MenuLabel* authorLabel = new ui::MenuLabel;
authorLabel->text = "by " + model->plugin->author;
menu->addChild(authorLabel);
authorItem->disabled = true;
}
menu->addChild(authorItem);
}

// version
ui::MenuLabel* versionLabel = new ui::MenuLabel;
versionLabel->text = "v" + model->plugin->version;
menu->addChild(versionLabel);
// license
if (model->plugin->license != "") {
ui::MenuLabel* licenseLabel = new ui::MenuLabel;
licenseLabel->text = "License: " + model->plugin->license;
menu->addChild(licenseLabel);
}

// tags
if (!model->tags.empty()) {
@@ -89,13 +91,19 @@ struct ModuleInfoItem : ui::MenuItem {
menu->addChild(tagsLabel);
for (int tagId : model->tags) {
ui::MenuLabel* tagLabel = new ui::MenuLabel;
tagLabel->text = tag::getTag(tagId);
tagLabel->text = "• " + tag::getTag(tagId);
menu->addChild(tagLabel);
}
}

menu->addChild(new ui::MenuSeparator);

// library
ModuleUrlItem* libraryItem = new ModuleUrlItem;
libraryItem->text = "VCV Library entry";
libraryItem->url = "https://library.vcvrack.com/" + model->plugin->slug + "/" + model->slug;
menu->addChild(libraryItem);

// manual
std::string manualUrl = (model->manualUrl != "") ? model->manualUrl : model->plugin->manualUrl;
if (manualUrl != "") {
@@ -105,14 +113,6 @@ struct ModuleInfoItem : ui::MenuItem {
menu->addChild(manualItem);
}

// source code
if (model->plugin->sourceUrl != "") {
ModuleUrlItem* sourceItem = new ModuleUrlItem;
sourceItem->text = "Source code";
sourceItem->url = model->plugin->sourceUrl;
menu->addChild(sourceItem);
}

// donate
if (model->plugin->donateUrl != "") {
ModuleUrlItem* donateItem = new ModuleUrlItem;
@@ -129,11 +129,13 @@ struct ModuleInfoItem : ui::MenuItem {
menu->addChild(changelogItem);
}

// library
ModuleUrlItem* libraryItem = new ModuleUrlItem;
libraryItem->text = "VCV Library page";
libraryItem->url = "https://library.vcvrack.com/" + model->plugin->slug + "/" + model->slug;
menu->addChild(libraryItem);
// source code
if (model->plugin->sourceUrl != "") {
ModuleUrlItem* sourceItem = new ModuleUrlItem;
sourceItem->text = "Source code";
sourceItem->url = model->plugin->sourceUrl;
menu->addChild(sourceItem);
}

// plugin folder
if (model->plugin->path != "") {


Loading…
Cancel
Save