From 1bdf43dd78ac5b0ffdd6e5bdf3290166502b39f3 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 3 Nov 2019 18:17:51 -0600 Subject: [PATCH 1/2] DolphinQt: Fix spacebar not activating output mapping buttons. --- .../DolphinQt/Config/Mapping/MappingButton.cpp | 14 ++++++-------- .../Core/DolphinQt/Config/Mapping/MappingButton.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp index a9a142276f..d472aa619f 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp @@ -56,7 +56,7 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool setToolTip( tr("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options.")); - connect(this, &MappingButton::clicked, this, &MappingButton::Detect); + connect(this, &MappingButton::clicked, this, &MappingButton::Clicked); if (indicator) connect(parent, &MappingWidget::Update, this, &MappingButton::UpdateIndicator); @@ -74,10 +74,13 @@ void MappingButton::AdvancedPressed() m_parent->SaveSettings(); } -void MappingButton::Detect() +void MappingButton::Clicked() { if (!m_reference->IsInput()) + { + AdvancedPressed(); return; + } const auto default_device_qualifier = m_parent->GetController()->GetDefaultDevice(); @@ -141,12 +144,6 @@ void MappingButton::mouseReleaseEvent(QMouseEvent* event) { switch (event->button()) { - case Qt::MouseButton::LeftButton: - if (m_reference->IsInput()) - QPushButton::mouseReleaseEvent(event); - else - AdvancedPressed(); - return; case Qt::MouseButton::MidButton: Clear(); return; @@ -154,6 +151,7 @@ void MappingButton::mouseReleaseEvent(QMouseEvent* event) AdvancedPressed(); return; default: + QPushButton::mouseReleaseEvent(event); return; } } diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingButton.h b/Source/Core/DolphinQt/Config/Mapping/MappingButton.h index 464d09e9f6..775be6ec97 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingButton.h +++ b/Source/Core/DolphinQt/Config/Mapping/MappingButton.h @@ -18,7 +18,6 @@ class MappingButton : public ElidedButton public: MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator); - void Detect(); bool IsInput() const; private: @@ -27,6 +26,7 @@ private: void ConfigChanged(); void AdvancedPressed(); + void Clicked(); void mouseReleaseEvent(QMouseEvent* event) override; MappingWidget* m_parent; From 32cf4b76be6202407b98b047d5dc09ffd6774ce1 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 3 Nov 2019 18:20:08 -0600 Subject: [PATCH 2/2] DolphinQt: Fix tooltip of output mapping buttons. --- .../Core/DolphinQt/Config/Mapping/MappingButton.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp index d472aa619f..6b1b1fce73 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp @@ -53,8 +53,15 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - setToolTip( - tr("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options.")); + if (IsInput()) + { + setToolTip( + tr("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options.")); + } + else + { + setToolTip(tr("Left/Right-click to configure output.\nMiddle-click to clear.")); + } connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);