2017-05-20 15:53:17 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-05-20 15:53:17 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
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;
|
2024-11-02 07:52:18 +00:00
|
|
|
class MappingWindow;
|
2017-05-20 15:53:17 +00:00
|
|
|
class QEvent;
|
|
|
|
class QMouseEvent;
|
|
|
|
|
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
|
|
|
|
2018-04-01 14:25:34 +00:00
|
|
|
bool IsInput() const;
|
2024-11-02 07:52:18 +00:00
|
|
|
ControlReference* GetControlReference();
|
|
|
|
void StartMapping();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void ConfigChanged();
|
2017-05-20 15:53:17 +00:00
|
|
|
|
2019-03-15 01:27:49 +00:00
|
|
|
private:
|
|
|
|
void Clear();
|
|
|
|
void UpdateIndicator();
|
2017-06-13 15:16:41 +00:00
|
|
|
void AdvancedPressed();
|
|
|
|
|
2019-11-04 00:17:51 +00:00
|
|
|
void Clicked();
|
2017-05-20 15:53:17 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
|
|
|
|
2024-11-02 07:52:18 +00:00
|
|
|
MappingWindow* const m_mapping_window;
|
|
|
|
ControlReference* const m_reference;
|
|
|
|
bool m_is_mapping = false;
|
2017-05-20 15:53:17 +00:00
|
|
|
};
|