From 7985875d7c818075db3d8f2a2dd2bea4b035236d Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Fri, 7 Nov 2025 15:33:57 +0100 Subject: [PATCH] RMG-Input: track state of children in {disable,enable}AllChildren() --- .../UserInterface/Widget/ControllerWidget.cpp | 14 ++++++++++++++ .../UserInterface/Widget/ControllerWidget.hpp | 2 ++ 2 files changed, 16 insertions(+) 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();