MappingButton: derive from ElidedButton

This commit is contained in:
Michael Maltese 2017-05-30 23:09:43 -07:00
parent b378ffb4ec
commit 046c6f468f
3 changed files with 5 additions and 3 deletions

View File

@ -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();
}

View File

@ -5,15 +5,16 @@
#pragma once
#include <QPoint>
#include <QPushButton>
#include <QString>
#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);

View File

@ -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);