| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include "DolphinQt/QtUtils/ElidedButton.h" |
| 7 |
|
| 8 |
class ControlReference; |
| 9 |
class MappingWidget; |
| 10 |
class MappingWindow; |
| 11 |
class QEvent; |
| 12 |
class QMouseEvent; |
| 13 |
|
| 14 |
class MappingButton : public ElidedButton |
| 15 |
{ |
| 16 |
Q_OBJECT |
| 17 |
public: |
| 18 |
enum class ControlType |
| 19 |
{ |
| 20 |
NormalInput, |
| 21 |
ModifierInput, |
| 22 |
Output, |
| 23 |
}; |
| 24 |
|
| 25 |
MappingButton(MappingWidget* widget, ControlReference* ref, ControlType type); |
| 26 |
|
| 27 |
ControlReference* GetControlReference(); |
| 28 |
ControlType GetControlType() const; |
| 29 |
|
| 30 |
signals: |
| 31 |
void ConfigChanged(); |
| 32 |
void QueueNextButtonMapping(); |
| 33 |
|
| 34 |
private: |
| 35 |
void Clear(); |
| 36 |
void AdvancedPressed(); |
| 37 |
|
| 38 |
void Clicked(); |
| 39 |
void mouseReleaseEvent(QMouseEvent* event) override; |
| 40 |
|
| 41 |
MappingWindow* const m_mapping_window; |
| 42 |
ControlReference* const m_reference; |
| 43 |
const ControlType m_control_type; |
| 44 |
}; |