| 302 | } |
| 303 | |
| 304 | ui::Tooltip* createTooltip() { |
| 305 | std::string text; |
| 306 | text += model->name; |
| 307 | text += "\n"; |
| 308 | text += model->plugin->brand; |
| 309 | // Description |
| 310 | if (model->description != "") { |
| 311 | text += "\n" + model->description; |
| 312 | } |
| 313 | // Tags |
| 314 | text += "\n\n"; |
| 315 | text += string::translate("Browser.tooltipTags"); |
| 316 | std::vector<std::string> tags; |
| 317 | for (int tagId : model->tagIds) { |
| 318 | std::string tag = string::translate("tag." + tag::getTag(tagId)); |
| 319 | tags.push_back(tag); |
| 320 | } |
| 321 | text += string::join(tags, ", "); |
| 322 | ui::Tooltip* tooltip = new ui::Tooltip; |
| 323 | tooltip->text = text; |
| 324 | return tooltip; |
| 325 | } |
| 326 | |
| 327 | void onEnter(const EnterEvent& e) override { |
| 328 | setTooltip(createTooltip()); |