diff --git a/src/app/PortWidget.cpp b/src/app/PortWidget.cpp index 2f3463cb..332f4c1b 100644 --- a/src/app/PortWidget.cpp +++ b/src/app/PortWidget.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace rack { @@ -65,13 +66,20 @@ void PortWidget::onButton(const event::Button &e) { if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_RIGHT) { CableWidget *cw = APP->scene->rack->getTopCable(this); if (cw) { - // history::CableRemove - history::CableRemove *h = new history::CableRemove; - h->setCable(cw); - APP->history->push(h); - - APP->scene->rack->removeCable(cw); - delete cw; + if ((APP->window->getMods() & RACK_MOD_MASK) == RACK_MOD_CTRL) { + int id = APP->scene->rack->nextCableColorId++; + APP->scene->rack->nextCableColorId %= settings::cableColors.size(); + cw->color = settings::cableColors[id]; + } else + { + // history::CableRemove + history::CableRemove *h = new history::CableRemove; + h->setCable(cw); + APP->history->push(h); + + APP->scene->rack->removeCable(cw); + delete cw; + } } e.consume(this);