mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
RMG-Input: track state of children in {disable,enable}AllChildren()
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user