| 123 | CableWidget* cw; |
| 124 | |
| 125 | void onButton(const ButtonEvent& e) override { |
| 126 | OpaqueWidget::onButton(e); |
| 127 | if (disabled) |
| 128 | return; |
| 129 | if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0) { |
| 130 | // Set PortWidget::onDragStart overrides |
| 131 | pw->internal->overrideCws.push_back(cw); |
| 132 | |
| 133 | // Pretend the PortWidget was clicked |
| 134 | e.consume(pw); |
| 135 | // Deletes `this` |
| 136 | doAction(); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | ui::Menu* createChildMenu() override { |
| 141 | ui::Menu* menu = new ui::Menu; |