Add option to disable variable selection

This commit is contained in:
WarmUpTill
2023-07-26 19:49:37 +02:00
committed by WarmUpTill
parent 7b1c56877e
commit 52811e44f4
2 changed files with 13 additions and 2 deletions

View File

@@ -76,6 +76,13 @@ void GenericVaraiableSpinbox::SetValue(const NumberVariable<double> &number)
SetVisibility();
}
void GenericVaraiableSpinbox::DisableVariableSelection()
{
_hideTypeToggle = true;
_toggleType->hide();
ToggleTypeClicked(false);
}
void GenericVaraiableSpinbox::setMinimum(double value)
{
_fixedValueInt->setMinimum(value);
@@ -168,7 +175,8 @@ void GenericVaraiableSpinbox::SetVisibilityInt()
if (_numberInt.IsFixedType()) {
_fixedValueInt->show();
_variable->hide();
_toggleType->setVisible(!switcher->variables.empty());
_toggleType->setVisible(!switcher->variables.empty() &&
!_hideTypeToggle);
} else {
_fixedValueInt->hide();
_variable->show();
@@ -183,7 +191,8 @@ void GenericVaraiableSpinbox::SetVisibilityDouble()
if (_numberDouble.IsFixedType()) {
_fixedValueDouble->show();
_variable->hide();
_toggleType->setVisible(!switcher->variables.empty());
_toggleType->setVisible(!switcher->variables.empty() &&
!_hideTypeToggle);
} else {
_fixedValueDouble->hide();
_variable->show();