diff options
| author | Léo Lam <leolino.lam@gmail.com> | 2018-04-05 17:44:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-05 17:44:30 +0200 |
| commit | 4cd5ef76adfb863e59252c21e8812adeaae42b33 (patch) | |
| tree | 4cae8d17d190f6a563a6dae457ffe8f4a872369d /Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp | |
| parent | a66c7d6a64865c3b0fe4b1981f91f2d4b9699e93 (diff) | |
| parent | e0ba2a4aebc47e00ccc78c630ea89d2172ed51e7 (diff) | |
Merge pull request #6537 from spycrab/qt_quick_assign
Qt/Mapping: Implement "Iterative Input"
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp index efe64ac2ce..01913ca8c7 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp @@ -31,6 +31,29 @@ MappingWindow* MappingWidget::GetParent() const return m_parent; } +bool MappingWidget::IsIterativeInput() const +{ + return m_parent->IsIterativeInput(); +} + +void MappingWidget::NextButton(MappingButton* button) +{ + auto iterator = std::find(m_buttons.begin(), m_buttons.end(), button); + + if (iterator == m_buttons.end()) + return; + + if (++iterator == m_buttons.end()) + return; + + MappingButton* next = *iterator; + + if (next->IsInput() && next->isVisible()) + next->Detect(); + else + NextButton(next); +} + std::shared_ptr<ciface::Core::Device> MappingWidget::GetDevice() const { return m_parent->GetDevice(); |
