Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 211:84422236db20
* Add function to toggle all time ruler display on and off at once
author | Chris Cannam |
---|---|
date | Sun, 24 Oct 2010 17:39:00 +0200 |
parents | 944af6246560 |
children | eed79c69be61 |
comparison
equal
deleted
inserted
replaced
209:70b2681665a7 | 211:84422236db20 |
---|---|
2036 { | 2036 { |
2037 m_viewManager->setOverlayMode(ViewManager::AllOverlays); | 2037 m_viewManager->setOverlayMode(ViewManager::AllOverlays); |
2038 } | 2038 } |
2039 | 2039 |
2040 void | 2040 void |
2041 MainWindowBase::toggleTimeRulers() | |
2042 { | |
2043 bool haveRulers = false; | |
2044 bool someHidden = false; | |
2045 | |
2046 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { | |
2047 | |
2048 Pane *pane = m_paneStack->getPane(i); | |
2049 if (!pane) continue; | |
2050 | |
2051 for (int j = 0; j < pane->getLayerCount(); ++j) { | |
2052 | |
2053 Layer *layer = pane->getLayer(j); | |
2054 if (!dynamic_cast<TimeRulerLayer *>(layer)) continue; | |
2055 | |
2056 haveRulers = true; | |
2057 if (layer->isLayerDormant(pane)) someHidden = true; | |
2058 } | |
2059 } | |
2060 | |
2061 if (haveRulers) { | |
2062 | |
2063 bool show = someHidden; | |
2064 | |
2065 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { | |
2066 | |
2067 Pane *pane = m_paneStack->getPane(i); | |
2068 if (!pane) continue; | |
2069 | |
2070 for (int j = 0; j < pane->getLayerCount(); ++j) { | |
2071 | |
2072 Layer *layer = pane->getLayer(j); | |
2073 if (!dynamic_cast<TimeRulerLayer *>(layer)) continue; | |
2074 | |
2075 layer->showLayer(pane, show); | |
2076 } | |
2077 } | |
2078 } | |
2079 } | |
2080 | |
2081 void | |
2041 MainWindowBase::toggleZoomWheels() | 2082 MainWindowBase::toggleZoomWheels() |
2042 { | 2083 { |
2043 if (m_viewManager->getZoomWheelsEnabled()) { | 2084 if (m_viewManager->getZoomWheelsEnabled()) { |
2044 m_viewManager->setZoomWheelsEnabled(false); | 2085 m_viewManager->setZoomWheelsEnabled(false); |
2045 } else { | 2086 } else { |