Browse Source

Remove "Duplicate with cables" item from module and module selection

menu, but make key command Mod+shift+D disable cloning cables.
tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
357c0be7a1
5 changed files with 8 additions and 20 deletions
  1. +1
    -1
      include/app/ModuleWidget.hpp
  2. +1
    -1
      include/app/RackWidget.hpp
  3. +3
    -10
      src/app/ModuleWidget.cpp
  4. +1
    -6
      src/app/RackWidget.cpp
  5. +2
    -2
      src/app/Scene.cpp

+ 1
- 1
include/app/ModuleWidget.hpp View File

@@ -110,7 +110,7 @@ struct ModuleWidget : widget::OpaqueWidget {
void randomizeAction();
void appendDisconnectActions(history::ComplexAction* complexAction);
void disconnectAction();
void cloneAction(bool cloneCables);
void cloneAction(bool cloneCables = true);
void bypassAction(bool bypassed);
/** Deletes `this` */
void removeAction();


+ 1
- 1
include/app/RackWidget.hpp View File

@@ -91,7 +91,7 @@ struct RackWidget : widget::OpaqueWidget {
void resetSelectionAction();
void randomizeSelectionAction();
void disconnectSelectionAction();
void cloneSelectionAction(bool cloneCables);
void cloneSelectionAction(bool cloneCables = true);
void bypassSelectionAction(bool bypassed);
bool isSelectionBypassed();
void deleteSelectionAction();


+ 3
- 10
src/app/ModuleWidget.cpp View File

@@ -317,11 +317,11 @@ void ModuleWidget::onHoverKey(const HoverKeyEvent& e) {
}
}
if (e.keyName == "d" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
cloneAction(false);
cloneAction();
e.consume(this);
}
if (e.keyName == "d" && (e.mods & RACK_MOD_MASK) == (RACK_MOD_CTRL | GLFW_MOD_SHIFT)) {
cloneAction(true);
cloneAction(false);
e.consume(this);
}
if (e.keyName == "i" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
@@ -999,14 +999,7 @@ void ModuleWidget::createContextMenu() {
menu->addChild(createMenuItem("Duplicate", RACK_MOD_CTRL_NAME "+D", [=]() {
if (!weakThis)
return;
weakThis->cloneAction(false);
}));

// Duplicate with cables
menu->addChild(createMenuItem("Duplicate with cables", RACK_MOD_CTRL_NAME "+" RACK_MOD_SHIFT_NAME "+D", [=]() {
if (!weakThis)
return;
weakThis->cloneAction(true);
weakThis->cloneAction();
}));

// Delete


+ 1
- 6
src/app/RackWidget.cpp View File

@@ -1227,12 +1227,7 @@ void RackWidget::appendSelectionContextMenu(ui::Menu* menu) {

// Duplicate
menu->addChild(createMenuItem("Duplicate", RACK_MOD_CTRL_NAME "+D", [=]() {
cloneSelectionAction(false);
}, n == 0));

// Duplicate with cables
menu->addChild(createMenuItem("Duplicate with cables", RACK_MOD_CTRL_NAME "+" RACK_MOD_SHIFT_NAME "+D", [=]() {
cloneSelectionAction(true);
cloneSelectionAction();
}, n == 0));

// Delete


+ 2
- 2
src/app/Scene.cpp View File

@@ -280,13 +280,13 @@ void Scene::onHoverKey(const HoverKeyEvent& e) {
}
if (e.keyName == "d" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
if (rack->hasSelection()) {
rack->cloneSelectionAction(false);
rack->cloneSelectionAction();
e.consume(this);
}
}
if (e.keyName == "d" && (e.mods & RACK_MOD_MASK) == (RACK_MOD_CTRL | GLFW_MOD_SHIFT)) {
if (rack->hasSelection()) {
rack->cloneSelectionAction(true);
rack->cloneSelectionAction(false);
e.consume(this);
}
}


Loading…
Cancel
Save