Mercurial > hg > svgui
diff view/ViewManager.cpp @ 711:084fd76deb89 tonioni
Allow per-pane overrides for tool mode
author | Chris Cannam |
---|---|
date | Thu, 09 Jan 2014 16:41:55 +0000 |
parents | ad12e428785b |
children | f831ca41d4a5 |
line wrap: on
line diff
--- a/view/ViewManager.cpp Thu Jan 09 09:18:17 2014 +0000 +++ b/view/ViewManager.cpp Thu Jan 09 16:41:55 2014 +0000 @@ -364,6 +364,28 @@ }; } +ViewManager::ToolMode +ViewManager::getToolModeFor(const View *v) const +{ + if (m_toolModeOverrides.find(v) == m_toolModeOverrides.end()) { + return getToolMode(); + } else { + return m_toolModeOverrides.find(v)->second; + } +} + +void +ViewManager::setToolModeFor(const View *v, ToolMode mode) +{ + m_toolModeOverrides[v] = mode; +} + +void +ViewManager::clearToolModeOverrides() +{ + m_toolModeOverrides.clear(); +} + void ViewManager::setPlayLoopMode(bool mode) {