From fbabf737e2185b7ef432b2eec5c83aac5e8211c8 Mon Sep 17 00:00:00 2001 From: kosta Date: Wed, 29 Mar 2023 19:03:09 +0200 Subject: [PATCH] [bos #32736][CEA] Threshold of criteria. Fixed checking of Logarithmic checkbox on min-max changing. --- .../SMESHGUI_Preferences_ScalarBarDlg.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index 27870e218..89faee306 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -745,11 +745,19 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged() //================================================================================================= void SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged() { - double aMin = myMinEdit->text().toDouble(); - double aMax = myMaxEdit->text().toDouble(); - bool isLogarithmicEnabled = (aMin > 1e-07 && aMax > 1e-07); - myLogarithmicCheck->setChecked(isLogarithmicEnabled); + // Check if the min-max range is valid. + const double aMin = myMinEdit->text().toDouble(); + const double aMax = myMaxEdit->text().toDouble(); + const bool isLogarithmicEnabled = aMin > 1e-07 && aMax > 1e-07; // TODO: is it right validation? + + // The checkbox should be enabled only when the range is valid for it myLogarithmicCheck->setEnabled(isLogarithmicEnabled); + + // Change checkbox only if the range is not valid. Otherwise it's on the user decision. + if (!isLogarithmicEnabled) + { + myLogarithmicCheck->setChecked(isLogarithmicEnabled); + } } //================================================================================================= -- 2.39.2