Cleanup whitespace

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-03-11 22:33:18 +00:00
parent 1ff860d8e5
commit d6cc4af637
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0

View file

@ -304,61 +304,62 @@ void CardinalModuleWidget::onButton(const ButtonEvent& e)
if (selected) { if (selected) {
if (e.button == GLFW_MOUSE_BUTTON_RIGHT) { if (e.button == GLFW_MOUSE_BUTTON_RIGHT) {
if (e.action == GLFW_PRESS) { if (e.action == GLFW_PRESS) {
// Open selection context menu on right-click
ui::Menu* menu = createMenu(); ui::Menu* menu = createMenu();
patchUtils::appendSelectionContextMenu(menu); patchUtils::appendSelectionContextMenu(menu);
} }
e.consume(this); e.consume(this);
} }
if (e.button == GLFW_MOUSE_BUTTON_LEFT) { if (e.button == GLFW_MOUSE_BUTTON_LEFT) {
if (e.action == GLFW_PRESS) { if (e.action == GLFW_PRESS) {
// Toggle selection on Shift-click // Toggle selection on Shift-click
if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) { if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) {
APP->scene->rack->select(this, false); APP->scene->rack->select(this, false);
e.consume(NULL); e.consume(NULL);
return; return;
} }
internal->dragOffset = e.pos; internal->dragOffset = e.pos;
} }
e.consume(this); e.consume(this);
} }
return; return;
} }
// Dispatch event to children // Dispatch event to children
Widget::onButton(e); Widget::onButton(e);
e.stopPropagating(); e.stopPropagating();
if (e.isConsumed()) if (e.isConsumed())
return; return;
if (e.button == GLFW_MOUSE_BUTTON_LEFT) { if (e.button == GLFW_MOUSE_BUTTON_LEFT) {
if (e.action == GLFW_PRESS) { if (e.action == GLFW_PRESS) {
// Toggle selection on Shift-click // Toggle selection on Shift-click
if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) { if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) {
APP->scene->rack->select(this, true); APP->scene->rack->select(this, true);
e.consume(NULL); e.consume(NULL);
return; return;
} }
// If module positions are locked, don't consume left-click // If module positions are locked, don't consume left-click
if (settings::lockModules) { if (settings::lockModules) {
return; return;
} }
internal->dragOffset = e.pos; internal->dragOffset = e.pos;
} }
e.consume(this); e.consume(this);
} }
// Open context menu on right-click // Open context menu on right-click
if (e.button == GLFW_MOUSE_BUTTON_RIGHT && e.action == GLFW_PRESS) { if (e.button == GLFW_MOUSE_BUTTON_RIGHT && e.action == GLFW_PRESS) {
CardinalModuleWidget__createContextMenu(this, model, module); CardinalModuleWidget__createContextMenu(this, model, module);
e.consume(this); e.consume(this);
} }
} }
} }