mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
MappingButton: derive from ElidedButton
This commit is contained in:
@ -17,7 +17,7 @@
|
|||||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||||
|
|
||||||
MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref)
|
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();
|
Connect();
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include "DolphinQt2/QtUtils/ElidedButton.h"
|
||||||
|
|
||||||
class ControlReference;
|
class ControlReference;
|
||||||
class MappingWidget;
|
class MappingWidget;
|
||||||
class QEvent;
|
class QEvent;
|
||||||
class QMouseEvent;
|
class QMouseEvent;
|
||||||
|
|
||||||
class MappingButton : public QPushButton
|
class MappingButton : public ElidedButton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MappingButton(MappingWidget* widget, ControlReference* ref);
|
MappingButton(MappingWidget* widget, ControlReference* ref);
|
||||||
|
@ -49,6 +49,7 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
|
|||||||
for (auto& control : group->controls)
|
for (auto& control : group->controls)
|
||||||
{
|
{
|
||||||
auto* button = new MappingButton(this, control->control_ref.get());
|
auto* button = new MappingButton(this, control->control_ref.get());
|
||||||
|
button->setMinimumWidth(125);
|
||||||
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
form_layout->addRow(QString::fromStdString(control->name), button);
|
form_layout->addRow(QString::fromStdString(control->name), button);
|
||||||
m_buttons.push_back(button);
|
m_buttons.push_back(button);
|
||||||
|
Reference in New Issue
Block a user