From 046c6f468f6b34bfcc6bb56f21af14fe1bf61fd4 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Tue, 30 May 2017 23:09:43 -0700 Subject: [PATCH] MappingButton: derive from ElidedButton --- Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp | 2 +- Source/Core/DolphinQt2/Config/Mapping/MappingButton.h | 5 +++-- Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp index 017861d636..dcb92e6072 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp @@ -17,7 +17,7 @@ #include "InputCommon/ControllerInterface/ControllerInterface.h" MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref) - : QPushButton(QString::fromStdString(ref->expression)), m_parent(widget), m_reference(ref) + : ElidedButton(QString::fromStdString(ref->expression)), m_parent(widget), m_reference(ref) { Connect(); } diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.h b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.h index 304389297e..caaa9ad75f 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.h +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.h @@ -5,15 +5,16 @@ #pragma once #include -#include #include +#include "DolphinQt2/QtUtils/ElidedButton.h" + class ControlReference; class MappingWidget; class QEvent; class QMouseEvent; -class MappingButton : public QPushButton +class MappingButton : public ElidedButton { public: MappingButton(MappingWidget* widget, ControlReference* ref); diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp index 6daa56dfdd..bb711f3058 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp @@ -49,6 +49,7 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con for (auto& control : group->controls) { auto* button = new MappingButton(this, control->control_ref.get()); + button->setMinimumWidth(125); button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); form_layout->addRow(QString::fromStdString(control->name), button); m_buttons.push_back(button);