From c22f93762d9f941f81adf6eb6815dea4f8ee3eba Mon Sep 17 00:00:00 2001 From: Rodney Date: Mar 14 2022 19:04:52 +0000 Subject: Merge pull request #4323 from shun-iwasawa/disable_edit_shift Deactivate Edit Shift mode when deactivating Shift and Trace --- diff --git a/toonz/sources/tnztools/shifttracetool.cpp b/toonz/sources/tnztools/shifttracetool.cpp index 4738d63..d7f0265 100644 --- a/toonz/sources/tnztools/shifttracetool.cpp +++ b/toonz/sources/tnztools/shifttracetool.cpp @@ -348,6 +348,10 @@ void ShiftTraceTool::onActivate() { } void ShiftTraceTool::onDeactivate() { + // Deactivating Shift and Trace mode resets the pseudo tool with keeping the + // Edit Shift checkbox unchanged + QAction *shiftTrace = CommandManager::instance()->getAction("MI_ShiftTrace"); + if (!shiftTrace->isChecked()) return; QAction *action = CommandManager::instance()->getAction("MI_EditShift"); action->setChecked(false); } diff --git a/toonz/sources/toonz/sceneviewer.cpp b/toonz/sources/toonz/sceneviewer.cpp index 01c7d45..40fd9d6 100644 --- a/toonz/sources/toonz/sceneviewer.cpp +++ b/toonz/sources/toonz/sceneviewer.cpp @@ -404,7 +404,17 @@ public: if (std::string(m_cmdId) == MI_ShiftTrace) { cm->enable(MI_EditShift, checked); cm->enable(MI_NoShift, checked); - if (checked) OnioniSkinMaskGUI::resetShiftTraceFrameOffset(); + if (checked) { + OnioniSkinMaskGUI::resetShiftTraceFrameOffset(); + // activate edit shift + if (isChecked(MI_EditShift)) + TApp::instance()->getCurrentTool()->setPseudoTool("T_ShiftTrace"); + } else { + // deactivate edit shift + if (isChecked(MI_EditShift)) + TApp::instance()->getCurrentTool()->unsetPseudoTool(); + } + // cm->getAction(MI_NoShift)->setChecked(false); TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged(); } else if (std::string(m_cmdId) == MI_EditShift) {