diff --git a/toonz/sources/include/tools/strokeselection.h b/toonz/sources/include/tools/strokeselection.h index 02d371f..0757b3a 100644 --- a/toonz/sources/include/tools/strokeselection.h +++ b/toonz/sources/include/tools/strokeselection.h @@ -79,6 +79,8 @@ public: void enableCommands() override; + void selectAll(); + private: TVectorImageP m_vi; //!< Selected vector image. IndexesContainer m_indexes; //!< Selected stroke indexes in m_vi. diff --git a/toonz/sources/tnztools/strokeselection.cpp b/toonz/sources/tnztools/strokeselection.cpp index 020519d..22ac15c 100644 --- a/toonz/sources/tnztools/strokeselection.cpp +++ b/toonz/sources/tnztools/strokeselection.cpp @@ -455,6 +455,27 @@ void StrokeSelection::removeEndpoints() { m_updateSelectionBBox = false; } + +//============================================================================= +// +// selectAll +// +//----------------------------------------------------------------------------- + +void StrokeSelection::selectAll() { + if (!m_vi) return; + + int sCount = int(m_vi->getStrokeCount()); + + for (int s = 0; s < sCount; ++s) { + m_indexes.insert(s); + } + + StrokeSelection *selection = dynamic_cast( + TTool::getApplication()->getCurrentSelection()->getSelection()); + if (selection) selection->notifyView(); +} + //============================================================================= // // deleteStrokes @@ -613,6 +634,7 @@ void StrokeSelection::enableCommands() { enableCommand(m_groupCommand.get(), MI_ExitGroup, &TGroupCommand::exitGroup); enableCommand(this, MI_RemoveEndpoints, &StrokeSelection::removeEndpoints); + enableCommand(this, MI_SelectAll, &StrokeSelection::selectAll); } //===================================================================