Stop Double Click Key to Open Function Editor (#411)

This commit is contained in:
Jeremy Bullock 2020-10-24 00:09:36 -06:00 committed by GitHub
parent e8d1f92535
commit a65e4e9504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3039,15 +3039,21 @@ void CellArea::mouseDoubleClickEvent(QMouseEvent *event) {
int k0, k1;
bool isKeyframeFrame = pegbar && pegbar->getKeyframeRange(k0, k1) &&
k0 <= row && row <= k1 + 1;
// If you are in the keyframe area, open a function editor
if (isKeyframeFrame && isKeyFrameArea(col, row, mouseInCell)) {
QAction *action =
CommandManager::instance()->getAction(MI_OpenFunctionEditor);
action->trigger();
if (isKeyframeFrame &&
isKeyFrameArea(col, row,
mouseInCell)) { // They are in the keyframe selection
if (pegbar->isKeyframe(row)) // in the keyframe
{
m_viewer->setCurrentRow(
row); // If you click on the key, change the current row as well
setDragTool(XsheetGUI::DragTool::makeKeyframeMoverTool(m_viewer));
m_viewer->dragToolClick(event);
event->accept();
update();
return;
}
}
}
if (col == -1) return;
@ -3588,6 +3594,8 @@ void CellArea::createKeyLineMenu(QMenu &menu, int row, int col) {
}
connect(actionGroup, SIGNAL(triggered(QAction *)), this,
SLOT(onStepChanged(QAction *)));
menu.addSeparator();
menu.addAction(cmdManager->getAction(MI_OpenFunctionEditor));
}
//-----------------------------------------------------------------------------