From 523b4092396198cb5727e1440bd04f0073259dc2 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 4 Mar 2018 14:12:06 -0500 Subject: [PATCH] Add tag filtering to ModuleBrowser --- include/tags.hpp | 1 + src/app/ModuleBrowser.cpp | 152 ++++++++++++++++++++++++++++---------- src/tags.cpp | 1 + src/ui/TextField.cpp | 2 + 4 files changed, 118 insertions(+), 38 deletions(-) diff --git a/include/tags.hpp b/include/tags.hpp index 97f33052..a4e52165 100644 --- a/include/tags.hpp +++ b/include/tags.hpp @@ -9,6 +9,7 @@ namespace rack { To see comments, turn word wrap on. I'm using inline comments so I can automatically sort the list when more tags are added. */ enum ModelTag { + NO_TAG, // Don't use this in `Model::create(...)`. Instead, just omit the tags entirely. AMPLIFIER_TAG, ATTENUATOR_TAG, BLANK_TAG, diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index de9af24b..b6b420c3 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -2,6 +2,7 @@ #include "plugin.hpp" #include "window.hpp" #include +#include #define BND_LABEL_FONT_SIZE 13 @@ -150,15 +151,11 @@ struct ModelItem : BrowserListItem { struct ManufacturerItem : BrowserListItem { std::string manufacturer; - Label *manufacturerLabel; - - ManufacturerItem() { - } void setManufacturer(std::string manufacturer) { clearChildren(); this->manufacturer = manufacturer; - manufacturerLabel = Widget::create