RMG-Input: track state of children in {disable,enable}AllChildren()

This commit is contained in:
Rosalie Wanders
2025-11-07 15:33:57 +01:00
parent a66fe3bdce
commit 7985875d7c
2 changed files with 16 additions and 0 deletions
@@ -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)
@@ -93,6 +93,8 @@ private:
bool isCurrentDeviceKeyboard();
bool isCurrentDeviceNotFound();
bool disabledAllChildren = false;
void disableAllChildren();
void enableAllChildren();