#include "global_pre.hpp" #include "app.hpp" #include "plugin.hpp" #include "window.hpp" #include #include #include "global.hpp" #include "global_ui.hpp" static const float itemMargin = 2.0; namespace rack { bool isMatch(std::string s, std::string search) { s = stringLowercase(s); search = stringLowercase(search); return (s.find(search) != std::string::npos); } static bool isModelMatch(Model *model, std::string search) { if (search.empty()) return true; std::string s; s += model->plugin->slug; s += " "; s += model->author; s += " "; s += model->name; s += " "; s += model->slug; for (ModelTag tag : model->tags) { s += " "; s += gTagNames[tag]; } return isMatch(s, search); } struct FavoriteRadioButton : RadioButton { Model *model = NULL; void onAction(EventAction &e) override; }; struct SeparatorItem : OpaqueWidget { SeparatorItem() { box.size.y = 2*BND_WIDGET_HEIGHT + 2*itemMargin; } void setText(std::string text) { clearChildren(); Label *label = Widget::create