Browse Source

Add tags to ModuleBrowser tooltip.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
2c147c285e
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      src/app/ModuleBrowser.cpp

+ 15
- 4
src/app/ModuleBrowser.cpp View File

@@ -257,11 +257,22 @@ struct ModelBox : widget::OpaqueWidget {
}

void onEnter(const event::Enter &e) override {
ui::Tooltip *tooltip = new ui::Tooltip;
tooltip->text = model->plugin->brand;
tooltip->text += " " + model->name;
std::string text;
text = model->plugin->brand;
text += " " + model->name;
if (model->description != "")
tooltip->text += "\n" + model->description;
text += "\n" + model->description;
// Tags
if (!model->tags.empty()) {
text += "\n";
for (size_t i = 0; i < model->tags.size(); i++) {
if (i > 0)
text += ", ";
text += model->tags[i];
}
}
ui::Tooltip *tooltip = new ui::Tooltip;
tooltip->text = text;
setTooltip(tooltip);
}



Loading…
Cancel
Save