dolphin/Source/Core/DolphinQt/Config/ControllersWindow.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.3 KiB
C++
Raw Normal View History

2017-05-09 16:49:10 +00:00
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
2018-07-06 22:40:15 +00:00
#include "DolphinQt/Config/ControllersWindow.h"
2017-05-09 16:49:10 +00:00
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include "DolphinQt/Config/CommonControllersWidget.h"
#include "DolphinQt/Config/GamecubeControllersWidget.h"
#include "DolphinQt/Config/WiimoteControllersWidget.h"
2018-07-06 22:40:15 +00:00
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
2017-05-09 16:49:10 +00:00
ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent)
2017-05-09 16:49:10 +00:00
{
setWindowTitle(tr("Controller Settings"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
2017-05-09 16:49:10 +00:00
m_gamecube_controllers = new GamecubeControllersWidget(this);
m_wiimote_controllers = new WiimoteControllersWidget(this);
m_common = new CommonControllersWidget(this);
2017-05-09 16:49:10 +00:00
CreateMainLayout();
ConnectWidgets();
}
void ControllersWindow::CreateMainLayout()
{
2018-03-17 15:07:51 +00:00
auto* layout = new QVBoxLayout();
2018-03-20 09:12:11 +00:00
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
2017-05-09 16:49:10 +00:00
layout->addWidget(m_gamecube_controllers);
layout->addWidget(m_wiimote_controllers);
layout->addWidget(m_common);
layout->addStretch();
2018-03-17 15:07:51 +00:00
layout->addWidget(m_button_box);
2017-05-09 16:49:10 +00:00
2018-03-17 15:07:51 +00:00
WrapInScrollArea(this, layout);
2017-05-09 16:49:10 +00:00
}
void ControllersWindow::ConnectWidgets()
{
2018-03-20 09:12:11 +00:00
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
2017-05-09 16:49:10 +00:00
}