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

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

44 lines
1.3 KiB
C++
Raw Normal View History

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