Browse Source

Add port name to PortCableItem in port context menu.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
947170198f
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/app/PortWidget.cpp

+ 9
- 3
src/app/PortWidget.cpp View File

@@ -180,6 +180,8 @@ void PortWidget::createContextMenu() {
else {
}

menu->addChild(new ui::MenuSeparator);

// Create cable items
bool createCableDisabled = (type == engine::Port::INPUT) && topCw;
for (NVGcolor color : settings::cableColors) {
@@ -194,9 +196,13 @@ void PortWidget::createContextMenu() {
if (!cws.empty()) {
menu->addChild(new ui::MenuSeparator);

for (CableWidget* cw : cws) {
PortCableItem* item = createMenuItem<PortCableItem>(" XXXX", "Click+drag");
item->color = nvgRGBf(1, 0, 0);
for (auto it = cws.rbegin(); it != cws.rend(); it++) {
CableWidget* cw = *it;
PortWidget* pw = (type == engine::Port::INPUT) ? cw->outputPort : cw->inputPort;
engine::PortInfo* portInfo = pw->getPortInfo();

PortCableItem* item = createMenuItem<PortCableItem>(" " + portInfo->module->model->name + ": " + portInfo->getName());
item->color = cw->color;
menu->addChild(item);
}
}


Loading…
Cancel
Save