# HG changeset patch # User Chris Cannam # Date 1287934740 -7200 # Node ID 84422236db206b2882cd3c40b0c33b5aa36e32ae # Parent 70b2681665a763020b054388ffdee10b0dad167a * Add function to toggle all time ruler display on and off at once diff -r 70b2681665a7 -r 84422236db20 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Fri Oct 08 13:30:56 2010 +0100 +++ b/framework/MainWindowBase.cpp Sun Oct 24 17:39:00 2010 +0200 @@ -2038,6 +2038,47 @@ } void +MainWindowBase::toggleTimeRulers() +{ + bool haveRulers = false; + bool someHidden = false; + + for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { + + Pane *pane = m_paneStack->getPane(i); + if (!pane) continue; + + for (int j = 0; j < pane->getLayerCount(); ++j) { + + Layer *layer = pane->getLayer(j); + if (!dynamic_cast(layer)) continue; + + haveRulers = true; + if (layer->isLayerDormant(pane)) someHidden = true; + } + } + + if (haveRulers) { + + bool show = someHidden; + + for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { + + Pane *pane = m_paneStack->getPane(i); + if (!pane) continue; + + for (int j = 0; j < pane->getLayerCount(); ++j) { + + Layer *layer = pane->getLayer(j); + if (!dynamic_cast(layer)) continue; + + layer->showLayer(pane, show); + } + } + } +} + +void MainWindowBase::toggleZoomWheels() { if (m_viewManager->getZoomWheelsEnabled()) { diff -r 70b2681665a7 -r 84422236db20 framework/MainWindowBase.h --- a/framework/MainWindowBase.h Fri Oct 08 13:30:56 2010 +0100 +++ b/framework/MainWindowBase.h Sun Oct 24 17:39:00 2010 +0200 @@ -171,6 +171,7 @@ virtual void showStandardOverlays(); virtual void showAllOverlays(); + virtual void toggleTimeRulers(); virtual void toggleZoomWheels(); virtual void togglePropertyBoxes(); virtual void toggleStatusBar();