mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-22 01:57:31 -05:00
Add option to disable variable selection
This commit is contained in:
parent
7b1c56877e
commit
52811e44f4
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public:
|
|||
GenericVaraiableSpinbox(QWidget *parent, bool wholeNumber);
|
||||
void SetValue(const NumberVariable<int> &);
|
||||
void SetValue(const NumberVariable<double> &);
|
||||
void DisableVariableSelection();
|
||||
|
||||
void setMinimum(double value);
|
||||
void setMaximum(double value);
|
||||
|
|
@ -54,6 +55,7 @@ private:
|
|||
QPushButton *_toggleType;
|
||||
VariableSelection *_variable;
|
||||
bool _wholeNumber;
|
||||
bool _hideTypeToggle = false;
|
||||
};
|
||||
|
||||
class VariableSpinBox : public GenericVaraiableSpinbox {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user