2017-05-20 15:53:17 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-06-14 00:36:30 +00:00
|
|
|
#include "Common/Flag.h"
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/QtUtils/ElidedButton.h"
|
2017-05-31 06:09:43 +00:00
|
|
|
|
2017-05-20 15:53:17 +00:00
|
|
|
class ControlReference;
|
|
|
|
class MappingWidget;
|
|
|
|
class QEvent;
|
|
|
|
class QMouseEvent;
|
2018-02-06 10:00:23 +00:00
|
|
|
class QTimer;
|
2017-05-20 15:53:17 +00:00
|
|
|
|
2017-05-31 06:09:43 +00:00
|
|
|
class MappingButton : public ElidedButton
|
2017-05-20 15:53:17 +00:00
|
|
|
{
|
2017-06-13 15:16:41 +00:00
|
|
|
Q_OBJECT
|
2017-05-20 15:53:17 +00:00
|
|
|
public:
|
2018-02-06 10:00:23 +00:00
|
|
|
MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator);
|
2017-05-20 15:53:17 +00:00
|
|
|
|
|
|
|
void Clear();
|
|
|
|
void Update();
|
2018-04-01 14:25:34 +00:00
|
|
|
void Detect();
|
|
|
|
bool IsInput() const;
|
2017-05-20 15:53:17 +00:00
|
|
|
|
2017-06-13 15:16:41 +00:00
|
|
|
signals:
|
|
|
|
void AdvancedPressed();
|
|
|
|
|
2017-05-20 15:53:17 +00:00
|
|
|
private:
|
|
|
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
|
|
|
|
|
|
|
void OnButtonTimeout();
|
|
|
|
void Connect();
|
|
|
|
|
|
|
|
MappingWidget* m_parent;
|
|
|
|
ControlReference* m_reference;
|
2018-02-06 10:00:23 +00:00
|
|
|
QTimer* m_timer;
|
2017-05-20 15:53:17 +00:00
|
|
|
};
|