diff --git a/include/app/ParamWidget.hpp b/include/app/ParamWidget.hpp index bd72b976..de3ae2a6 100644 --- a/include/app/ParamWidget.hpp +++ b/include/app/ParamWidget.hpp @@ -2,8 +2,8 @@ #include #include #include +#include #include -#include namespace rack { @@ -30,6 +30,7 @@ struct ParamWidget : widget::OpaqueWidget { void onLeave(const event::Leave& e) override; void createContextMenu(); + virtual void appendContextMenu(ui::Menu* menu) {} void resetAction(); }; diff --git a/include/app/PortWidget.hpp b/include/app/PortWidget.hpp index 6d20378c..e961847d 100644 --- a/include/app/PortWidget.hpp +++ b/include/app/PortWidget.hpp @@ -14,8 +14,8 @@ namespace app { /** Manages an engine::Port on a ModuleWidget. */ struct PortWidget : widget::OpaqueWidget { engine::Module* module = NULL; - int portId = 0; engine::Port::Type type = engine::Port::INPUT; + int portId = 0; ui::Tooltip* tooltip = NULL; bool hovered = false; diff --git a/include/helpers.hpp b/include/helpers.hpp index 3b4da9be..737e6d6b 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -59,8 +60,8 @@ template TParamWidget* createParam(math::Vec pos, engine::Module* module, int paramId) { TParamWidget* o = new TParamWidget; o->box.pos = pos; - o->module = module; - o->paramId = paramId; + o->app::ParamWidget::module = module; + o->app::ParamWidget::paramId = paramId; o->init(); return o; } @@ -76,9 +77,9 @@ template TPortWidget* createInput(math::Vec pos, engine::Module* module, int inputId) { TPortWidget* o = new TPortWidget; o->box.pos = pos; - o->module = module; - o->type = engine::Port::INPUT; - o->portId = inputId; + o->app::PortWidget::module = module; + o->app::PortWidget::type = engine::Port::INPUT; + o->app::PortWidget::portId = inputId; return o; } @@ -93,9 +94,9 @@ template TPortWidget* createOutput(math::Vec pos, engine::Module* module, int outputId) { TPortWidget* o = new TPortWidget; o->box.pos = pos; - o->module = module; - o->type = engine::Port::OUTPUT; - o->portId = outputId; + o->app::PortWidget::module = module; + o->app::PortWidget::type = engine::Port::OUTPUT; + o->app::PortWidget::portId = outputId; return o; } @@ -110,8 +111,8 @@ template TModuleLightWidget* createLight(math::Vec pos, engine::Module* module, int firstLightId) { TModuleLightWidget* o = new TModuleLightWidget; o->box.pos = pos; - o->module = module; - o->firstLightId = firstLightId; + o->app::ModuleLightWidget::module = module; + o->app::ModuleLightWidget::firstLightId = firstLightId; return o; } diff --git a/src/app/ParamWidget.cpp b/src/app/ParamWidget.cpp index d283fa34..c26495c2 100644 --- a/src/app/ParamWidget.cpp +++ b/src/app/ParamWidget.cpp @@ -228,6 +228,8 @@ void ParamWidget::createContextMenu() { unmapItem->paramWidget = this; menu->addChild(unmapItem); } + + appendContextMenu(menu); } void ParamWidget::resetAction() {