diff --git a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp index 6b793177..45cc3bfe 100644 --- a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp +++ b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp @@ -274,6 +274,11 @@ bool ControllerWidget::isCurrentDeviceNotFound() void ControllerWidget::disableAllChildren() { + if (this->disabledAllChildren) + { + return; + } + for (auto& object : this->children()) { if (!object->inherits("QWidget")) @@ -292,10 +297,17 @@ void ControllerWidget::disableAllChildren() widget->setEnabled(false); } } + + this->disabledAllChildren = true; } void ControllerWidget::enableAllChildren() { + if (!this->disabledAllChildren) + { + return; + } + for (auto& object : this->children()) { if (!object->inherits("QWidget")) @@ -313,6 +325,8 @@ void ControllerWidget::enableAllChildren() widget->setEnabled(true); } } + + this->disabledAllChildren = false; } void ControllerWidget::removeDuplicates(MappingButton* button) diff --git a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp index 5e125772..805a66d1 100644 --- a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp +++ b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp @@ -93,6 +93,8 @@ private: bool isCurrentDeviceKeyboard(); bool isCurrentDeviceNotFound(); + bool disabledAllChildren = false; + void disableAllChildren(); void enableAllChildren();