[apps/shared] Add toggle buttons in Graph view

Change-Id: I7548d11fb114b2605ce34d3bda0776277b79ff9d
This commit is contained in:
Hugo Saint-Vignes
2020-10-08 16:54:32 +02:00
committed by Émilie Feral
parent a76e54642c
commit 2f97dab6d1
20 changed files with 226 additions and 66 deletions

View File

@@ -69,6 +69,11 @@ float InteractiveCurveViewController::addMargin(float y, float range, bool isVer
return y + ratio * range;
}
void InteractiveCurveViewController::updateZoomButtons() {
m_autoButton.setState(m_interactiveRange->zoomAuto());
m_normalizeButton.setState(m_interactiveRange->zoomNormalize());
}
const char * InteractiveCurveViewController::title() {
return I18n::translate(I18n::Message::GraphTab);
}
@@ -304,9 +309,7 @@ bool InteractiveCurveViewController::autoButtonAction() {
}
bool InteractiveCurveViewController::normalizeButtonAction() {
if (m_interactiveRange->zoomNormalize()) {
m_interactiveRange->setZoomNormalize(false);
} else {
if (!m_interactiveRange->zoomNormalize()) {
m_interactiveRange->setZoomAuto(false);
m_interactiveRange->normalize();
setCurveViewAsMainView();