Duckstation/src/duckstation-qt/controllersettingswidget.h

62 lines
1.5 KiB
C
Raw Normal View History

#pragma once
#include "core/types.h"
#include <QtWidgets/QComboBox>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QScrollArea>
#include <QtWidgets/QTabWidget>
#include <QtWidgets/QWidget>
#include <array>
#include <vector>
class QTimer;
class QtHostInterface;
2020-04-14 15:44:16 +00:00
class InputBindingWidget;
class ControllerSettingsWidget : public QWidget
{
Q_OBJECT
public:
ControllerSettingsWidget(QtHostInterface* host_interface, QWidget* parent = nullptr);
~ControllerSettingsWidget();
public Q_SLOTS:
void updateMultitapControllerTitles();
2020-04-14 15:44:16 +00:00
private Q_SLOTS:
void onProfileLoaded();
private:
QtHostInterface* m_host_interface;
QTabWidget* m_tab_widget;
struct PortSettingsUI
{
QWidget* widget;
QVBoxLayout* layout;
QComboBox* controller_type;
QScrollArea* bindings_scroll_area;
QWidget* bindings_container;
2020-04-14 15:44:16 +00:00
InputBindingWidget* first_button;
};
static MultitapMode getMultitapMode();
QString getTabTitleForPort(u32 index, MultitapMode mode) const;
void createUi();
2020-04-14 15:44:16 +00:00
void reloadBindingButtons();
void createPortSettingsUi(int index, PortSettingsUI* ui, MultitapMode multitap_mode);
void createPortBindingSettingsUi(int index, PortSettingsUI* ui, ControllerType ctype);
void onControllerTypeChanged(int index);
2020-04-14 15:44:16 +00:00
void onLoadProfileClicked();
void onSaveProfileClicked();
2021-01-21 07:59:40 +00:00
std::array<PortSettingsUI, NUM_CONTROLLER_AND_CARD_PORTS> m_port_ui = {};
};