OpenToonz - An open-source full-featured 2D animation creation software
C
Fix standard shortcuts not working while renaming cell
manongjohn646c640af540
diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cppindex c64c40cb2..32dfad496 100644--- a/toonz/sources/toonz/xshcellviewer.cpp+++ b/toonz/sources/toonz/xshcellviewer.cpp@@ -730,21 +730,28 @@ void RenameCellField::focusOutEvent(QFocusEvent *e) {// Override shortcut keys for cell selection commandsbool RenameCellField::eventFilter(QObject *obj, QEvent *e) {- if (e->type() != QEvent::ShortcutOverride) return false;+ // We really shouldn't allow OT defined shortcuts to be checked and used while renaming a cell+ // but if we must, we should only return true or false if we're executing our OT action;+ // otherwise pass event forward in case another object is interested in it.+ if (e->type() != QEvent::ShortcutOverride) return QObject::eventFilter(obj, e); //return false;TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(TApp::instance()->getCurrentSelection()->getSelection());- if (!cellSelection) return false;+ if (!cellSelection) return QObject::eventFilter(obj, e); //return false;QKeyEvent *ke = (QKeyEvent *)e;std::string keyStr =QKeySequence(ke->key() + ke->modifiers()).toString().toStdString();QAction *action = CommandManager::instance()->getActionFromShortcut(keyStr);- if (!action) return false;+ if (!action) return QObject::eventFilter(obj, e); //return false;std::string actionId = CommandManager::instance()->getIdFromAction(action);- if (actionId == "MI_Undo" || actionId == "MI_Redo") return true;+ // These are usally standard ctrl/command strokes for text editing.+ // Default to standard behavior and don't execute OT's action while renaming cell.+ if (actionId == "MI_Undo" || actionId == "MI_Redo"+ || actionId == "MI_Clear" || actionId == "MI_Copy" || actionId == "MI_Paste"+ ) return QObject::eventFilter(obj, e); //return true;return TCellSelection::isEnabledCommand(actionId);}