Skip to content
Permalink
Browse files

Qt/Mapping: Use QGridLayout in a few more places

  • Loading branch information...
spycrab committed Mar 16, 2019
1 parent e31ae0b commit e8b3c6cb3ec7fdbe9e2f8db128e6c1efbc43817e
@@ -4,10 +4,8 @@

#include "DolphinQt/Config/Mapping/GCPadEmu.h"

#include <QFormLayout>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QVBoxLayout>

#include "Core/HW/GCPad.h"
#include "Core/HW/GCPadEmu.h"
@@ -23,28 +21,26 @@ GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window)

void GCPadEmu::CreateMainLayout()
{
m_main_layout = new QHBoxLayout();

m_main_layout->addWidget(
CreateGroupBox(tr("Buttons"), Pad::GetGroup(GetPort(), PadGroup::Buttons)));
m_main_layout->addWidget(
CreateGroupBox(tr("Control Stick"), Pad::GetGroup(GetPort(), PadGroup::MainStick)));
m_main_layout->addWidget(
CreateGroupBox(tr("C Stick"), Pad::GetGroup(GetPort(), PadGroup::CStick)));
m_main_layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad)));

auto* hbox_layout = new QVBoxLayout();

m_main_layout->addLayout(hbox_layout);

hbox_layout->addWidget(
CreateGroupBox(tr("Triggers"), Pad::GetGroup(GetPort(), PadGroup::Triggers)));
hbox_layout->addWidget(CreateGroupBox(tr("Rumble"), Pad::GetGroup(GetPort(), PadGroup::Rumble)));

hbox_layout->addWidget(
CreateGroupBox(tr("Options"), Pad::GetGroup(GetPort(), PadGroup::Options)));

setLayout(m_main_layout);
auto* layout = new QGridLayout;

layout->addWidget(CreateGroupBox(tr("Buttons"), Pad::GetGroup(GetPort(), PadGroup::Buttons)), 0,
0, -1, 1);
layout->addWidget(
CreateGroupBox(tr("Control Stick"), Pad::GetGroup(GetPort(), PadGroup::MainStick)), 0, 1, -1,
1);
layout->addWidget(CreateGroupBox(tr("C Stick"), Pad::GetGroup(GetPort(), PadGroup::CStick)), 0, 2,
-1, 1);
layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad)), 0, 3, -1,
1);

layout->addWidget(CreateGroupBox(tr("Triggers"), Pad::GetGroup(GetPort(), PadGroup::Triggers)), 0,
4);
layout->addWidget(CreateGroupBox(tr("Rumble"), Pad::GetGroup(GetPort(), PadGroup::Rumble)), 1, 4);

layout->addWidget(CreateGroupBox(tr("Options"), Pad::GetGroup(GetPort(), PadGroup::Options)), 2,
4);

setLayout(layout);
}

void GCPadEmu::LoadSettings()
@@ -6,13 +6,6 @@

#include "DolphinQt/Config/Mapping/MappingWidget.h"

class QCheckBox;
class QFormLayout;
class QGroupBox;
class QHBoxLayout;
class QLabel;
class QVBoxLayout;

class GCPadEmu final : public MappingWidget
{
Q_OBJECT
@@ -25,6 +18,4 @@ class GCPadEmu final : public MappingWidget
void LoadSettings() override;
void SaveSettings() override;
void CreateMainLayout();

QHBoxLayout* m_main_layout;
};
@@ -4,9 +4,8 @@

#include "DolphinQt/Config/Mapping/HotkeyDebugging.h"

#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QVBoxLayout>

#include "Core/HotkeyManager.h"

@@ -17,16 +16,15 @@ HotkeyDebugging::HotkeyDebugging(MappingWindow* window) : MappingWidget(window)

void HotkeyDebugging::CreateMainLayout()
{
m_main_layout = new QHBoxLayout();
m_main_layout = new QGridLayout();

m_main_layout->addWidget(
CreateGroupBox(tr("Stepping"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_STEPPING)));
CreateGroupBox(tr("Stepping"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_STEPPING)), 0, 0, -1, 1);

auto* vbox = new QVBoxLayout();
vbox->addWidget(CreateGroupBox(tr("Program Counter"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_PC)));
vbox->addWidget(
CreateGroupBox(tr("Breakpoint"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_BREAKPOINT)));
m_main_layout->addLayout(vbox);
m_main_layout->addWidget(
CreateGroupBox(tr("Program Counter"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_PC)), 0, 1);
m_main_layout->addWidget(
CreateGroupBox(tr("Breakpoint"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_BREAKPOINT)), 1, 1);

setLayout(m_main_layout);
}
@@ -6,7 +6,7 @@

#include "DolphinQt/Config/Mapping/MappingWidget.h"

class QHBoxLayout;
class QGridLayout;

class HotkeyDebugging final : public MappingWidget
{
@@ -22,5 +22,5 @@ class HotkeyDebugging final : public MappingWidget
void CreateMainLayout();

// Main
QHBoxLayout* m_main_layout;
QGridLayout* m_main_layout;
};
@@ -4,9 +4,8 @@

#include "DolphinQt/Config/Mapping/HotkeyGeneral.h"

#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QVBoxLayout>

#include "Core/HotkeyManager.h"

@@ -17,16 +16,15 @@ HotkeyGeneral::HotkeyGeneral(MappingWindow* window) : MappingWidget(window)

void HotkeyGeneral::CreateMainLayout()
{
m_main_layout = new QHBoxLayout();
m_main_layout = new QGridLayout;

m_main_layout->addWidget(
CreateGroupBox(tr("General"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_GENERAL)));
CreateGroupBox(tr("General"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_GENERAL)), 0, 0, -1, 1);

auto* vbox = new QVBoxLayout();
vbox->addWidget(CreateGroupBox(tr("Volume"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_VOLUME)));
vbox->addWidget(
CreateGroupBox(tr("Emulation Speed"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SPEED)));
m_main_layout->addLayout(vbox);
m_main_layout->addWidget(
CreateGroupBox(tr("Volume"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_VOLUME)), 0, 1);
m_main_layout->addWidget(
CreateGroupBox(tr("Emulation Speed"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SPEED)), 1, 1);

setLayout(m_main_layout);
}
@@ -6,7 +6,7 @@

#include "DolphinQt/Config/Mapping/MappingWidget.h"

class QHBoxLayout;
class QGridLayout;

class HotkeyGeneral final : public MappingWidget
{
@@ -22,5 +22,5 @@ class HotkeyGeneral final : public MappingWidget
void CreateMainLayout();

// Main
QHBoxLayout* m_main_layout;
QGridLayout* m_main_layout;
};
@@ -4,9 +4,8 @@

#include "DolphinQt/Config/Mapping/HotkeyGraphics.h"

#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QVBoxLayout>

#include "Core/HotkeyManager.h"

@@ -17,17 +16,16 @@ HotkeyGraphics::HotkeyGraphics(MappingWindow* window) : MappingWidget(window)

void HotkeyGraphics::CreateMainLayout()
{
m_main_layout = new QHBoxLayout();
m_main_layout = new QGridLayout();

m_main_layout->addWidget(
CreateGroupBox(tr("Freelook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK)));

auto* vbox = new QVBoxLayout();
vbox->addWidget(CreateGroupBox(tr("Graphics Toggles"),
HotkeyManagerEmu::GetHotkeyGroup(HKGP_GRAPHICS_TOGGLES)));
vbox->addWidget(
CreateGroupBox(tr("Internal Resolution"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_IR)));
m_main_layout->addLayout(vbox);
CreateGroupBox(tr("Freelook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK)), 0, 0, -1, 1);

m_main_layout->addWidget(CreateGroupBox(tr("Graphics Toggles"),
HotkeyManagerEmu::GetHotkeyGroup(HKGP_GRAPHICS_TOGGLES)),
0, 1);
m_main_layout->addWidget(
CreateGroupBox(tr("Internal Resolution"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_IR)), 1, 1);

setLayout(m_main_layout);
}
@@ -6,7 +6,7 @@

#include "DolphinQt/Config/Mapping/MappingWidget.h"

class QHBoxLayout;
class QGridLayout;

class HotkeyGraphics final : public MappingWidget
{
@@ -22,5 +22,5 @@ class HotkeyGraphics final : public MappingWidget
void CreateMainLayout();

// Main
QHBoxLayout* m_main_layout;
QGridLayout* m_main_layout;
};

0 comments on commit e8b3c6c

Please sign in to comment.
You can’t perform that action at this time.