When changing units from psi to bar first change value, then max

otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2016-03-23 16:59:18 +01:00 committed by Dirk Hohndel
parent 0ae5f6faae
commit e93c99c8bc

View file

@ -450,12 +450,12 @@ void PlannerSettingsWidget::settingsChanged()
if(get_units()->pressure == units::BAR) {
ui.reserve_gas->setSuffix(tr("bar"));
ui.reserve_gas->setSingleStep(1);
ui.reserve_gas->setMaximum(100);
ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
ui.reserve_gas->setMaximum(300);
} else {
ui.reserve_gas->setSuffix(tr("psi"));
ui.reserve_gas->setSingleStep(10);
ui.reserve_gas->setMaximum(1500);
ui.reserve_gas->setMaximum(5000);
ui.reserve_gas->setValue(mbar_to_PSI(prefs.reserve_gas));
}