mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:13:24 +00:00
Update altitude limits on unit change
The limits set in diveplanner.ui is intended for the unit set there, meters. If we move between units we need to update the limits to. This fixes #201 Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
78150a4ed5
commit
78059d4010
1 changed files with 4 additions and 0 deletions
|
@ -196,8 +196,12 @@ void DivePlannerWidget::settingsChanged()
|
|||
// Adopt units
|
||||
if (get_units()->length == units::FEET) {
|
||||
ui.atmHeight->setSuffix("ft");
|
||||
ui.atmHeight->setMinimum(-300);
|
||||
ui.atmHeight->setMaximum(10000);
|
||||
} else {
|
||||
ui.atmHeight->setSuffix(("m"));
|
||||
ui.atmHeight->setMinimum(-100);
|
||||
ui.atmHeight->setMaximum(3000);
|
||||
}
|
||||
ui.atmHeight->blockSignals(true);
|
||||
ui.atmHeight->setValue((int) get_depth_units((int) (log(1013.0 / plannerModel->getSurfacePressure()) * 7800000), NULL,NULL));
|
||||
|
|
Loading…
Add table
Reference in a new issue