| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <QCheckBox> |
| 7 |
|
| 8 |
#include "DolphinQt/TAS/TASControlState.h" |
| 9 |
|
| 10 |
class QMouseEvent; |
| 11 |
class TASInputWindow; |
| 12 |
|
| 13 |
class TASCheckBox : public QCheckBox |
| 14 |
{ |
| 15 |
Q_OBJECT |
| 16 |
public: |
| 17 |
explicit TASCheckBox(const QString& text, TASInputWindow* parent); |
| 18 |
|
| 19 |
|
| 20 |
bool GetValue() const; |
| 21 |
|
| 22 |
void OnControllerValueChanged(bool new_value); |
| 23 |
|
| 24 |
protected: |
| 25 |
void mousePressEvent(QMouseEvent* event) override; |
| 26 |
|
| 27 |
private slots: |
| 28 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) |
| 29 |
void OnUIValueChanged(Qt::CheckState new_value); |
| 30 |
#else |
| 31 |
void OnUIValueChanged(int new_value); |
| 32 |
#endif |
| 33 |
void ApplyControllerValueChange(); |
| 34 |
|
| 35 |
private: |
| 36 |
const TASInputWindow* m_parent; |
| 37 |
TASControlState m_state; |
| 38 |
int m_frame_turbo_started = 0; |
| 39 |
int m_turbo_press_frames = 0; |
| 40 |
int m_turbo_total_frames = 0; |
| 41 |
}; |