From 2c147c285e2200e4e27e048c9f4e28663dbc86da Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 28 May 2019 00:23:40 -0400 Subject: [PATCH] Add tags to ModuleBrowser tooltip. --- src/app/ModuleBrowser.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index d369682f..50b00ae5 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -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); }