mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Updating stack zoom control enabling logic.
This commit is contained in:
@@ -371,6 +371,7 @@ AllPlotWindow::redrawAllPlot()
|
||||
//allPlot->setTitle("");
|
||||
allPlot->replot();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +500,11 @@ AllPlotWindow::rideSelected()
|
||||
redrawAllPlot();
|
||||
setupStackPlots();
|
||||
|
||||
if(showStack->isChecked()) {
|
||||
stackZoomUp->setEnabled(stackZoomUpShouldEnable(stackWidth));
|
||||
stackZoomDown->setEnabled(stackZoomDownShouldEnable(stackWidth));
|
||||
}
|
||||
|
||||
stale = false;
|
||||
}
|
||||
|
||||
@@ -1100,7 +1106,7 @@ AllPlotWindow::setStackZoomUp()
|
||||
|
||||
stackWidth = ceil(stackWidth * 1.25);
|
||||
setupStackPlots();
|
||||
|
||||
stackZoomUp->setEnabled(stackZoomUpShouldEnable(stackWidth));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1111,7 +1117,7 @@ AllPlotWindow::setStackZoomDown()
|
||||
|
||||
stackWidth = floor(stackWidth / 1.25);
|
||||
setupStackPlots();
|
||||
|
||||
stackZoomDown->setEnabled(stackZoomDownShouldEnable(stackWidth));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1132,15 +1138,18 @@ AllPlotWindow::showStackChanged(int value)
|
||||
if (value) {
|
||||
// refresh plots
|
||||
resetStackedDatas();
|
||||
stackZoomUp->setEnabled(stackZoomUpShouldEnable(stackWidth));
|
||||
stackZoomDown->setEnabled(stackZoomDownShouldEnable(stackWidth));
|
||||
|
||||
// now they are all set, lets replot them
|
||||
foreach(AllPlot *plot, allPlots) plot->replot();
|
||||
|
||||
stackZoomUp->setEnabled(stackZoomUpShouldEnable(stackWidth));
|
||||
stackZoomDown->setEnabled(stackZoomDownShouldEnable(stackWidth));
|
||||
} else {
|
||||
// refresh plots
|
||||
redrawAllPlot();
|
||||
|
||||
stackZoomUp->setEnabled(false);
|
||||
stackZoomDown->setEnabled(false);
|
||||
}
|
||||
|
||||
// reset the view
|
||||
@@ -1272,8 +1281,6 @@ AllPlotWindow::setupStackPlots()
|
||||
// we are now happy for a screen refresh to take place
|
||||
stackFrame->setUpdatesEnabled(true);
|
||||
|
||||
stackZoomUp->setEnabled(stackZoomUpShouldEnable(stackWidth));
|
||||
stackZoomDown->setEnabled(stackZoomDownShouldEnable(stackWidth));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user