Control mapping UI: Fix bug where we warn about combo mappings unnecessarily for axis input

This commit is contained in:
Henrik Rydgård
2023-12-20 15:37:46 +01:00
parent d339a4b985
commit 2d4e59eb62

View File

@@ -423,7 +423,8 @@ void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
InputMapping mapping(axis.deviceId, axis.axisId, 1);
triggeredAxes_.insert(mapping);
if (!g_Config.bAllowMappingCombos && !mapping_.mappings.empty()) {
comboMappingsNotEnabled_->SetVisibility(UI::V_VISIBLE);
if (mapping_.mappings.size() == 1 && mapping != mapping_.mappings[0])
comboMappingsNotEnabled_->SetVisibility(UI::V_VISIBLE);
} else if (!mapping_.mappings.contains(mapping)) {
mapping_.mappings.push_back(mapping);
RecreateViews();
@@ -432,7 +433,8 @@ void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
InputMapping mapping(axis.deviceId, axis.axisId, -1);
triggeredAxes_.insert(mapping);
if (!g_Config.bAllowMappingCombos && !mapping_.mappings.empty()) {
comboMappingsNotEnabled_->SetVisibility(UI::V_VISIBLE);
if (mapping_.mappings.size() == 1 && mapping != mapping_.mappings[0])
comboMappingsNotEnabled_->SetVisibility(UI::V_VISIBLE);
} else if (!mapping_.mappings.contains(mapping)) {
mapping_.mappings.push_back(mapping);
RecreateViews();