summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
index 5e7e0b0024..c8d185a2fe 100644
--- a/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
@@ -21,6 +21,7 @@
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
+#include "InputCommon/ControllerEmu/StickGate.h"
MappingWidget::MappingWidget(MappingWindow* window) : m_parent(window)
{
@@ -74,10 +75,14 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
group_box->setLayout(form_layout);
- bool need_indicator = group->type == ControllerEmu::GroupType::Cursor ||
- group->type == ControllerEmu::GroupType::Stick ||
- group->type == ControllerEmu::GroupType::Tilt ||
- group->type == ControllerEmu::GroupType::MixedTriggers;
+ const bool need_indicator = group->type == ControllerEmu::GroupType::Cursor ||
+ group->type == ControllerEmu::GroupType::Stick ||
+ group->type == ControllerEmu::GroupType::Tilt ||
+ group->type == ControllerEmu::GroupType::MixedTriggers;
+
+ const bool need_calibration = group->type == ControllerEmu::GroupType::Cursor ||
+ group->type == ControllerEmu::GroupType::Stick ||
+ group->type == ControllerEmu::GroupType::Tilt;
for (auto& control : group->controls)
{
@@ -136,7 +141,19 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
}
if (need_indicator)
- form_layout->addRow(new MappingIndicator(group));
+ {
+ auto const indicator = new MappingIndicator(group);
+
+ if (need_calibration)
+ {
+ const auto calibrate =
+ new CalibrationWidget(*static_cast<ControllerEmu::ReshapableInput*>(group), *indicator);
+
+ form_layout->addRow(calibrate);
+ }
+
+ form_layout->addRow(indicator);
+ }
return group_box;
}