summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2019-03-16 17:55:47 +0100
committerspycrab <spycrab@users.noreply.github.com>2019-03-20 23:46:45 +0100
commite8b3c6cb3ec7fdbe9e2f8db128e6c1efbc43817e (patch)
treef43c34714753fd3537ca81a5f8bc9410e03a238c /Source/Core
parente31ae0b3a0c26402f6a5be73a1546fa4b7c2f817 (diff)
Qt/Mapping: Use QGridLayout in a few more places
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/GCPadEmu.cpp46
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/GCPadEmu.h9
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.cpp16
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.h4
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.cpp16
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.h4
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.cpp20
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.h4
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/WiimoteEmuExtension.cpp140
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp43
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h4
11 files changed, 151 insertions, 155 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.cpp b/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.cpp
index 6ffc8d0c92..fe9ac2025a 100644
--- a/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.cpp
@@ -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()
diff --git a/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.h b/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.h
index 6eea1011a1..f8d529e379 100644
--- a/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.h
+++ b/Source/Core/DolphinQt/Config/Mapping/GCPadEmu.h
@@ -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 @@ private:
void LoadSettings() override;
void SaveSettings() override;
void CreateMainLayout();
-
- QHBoxLayout* m_main_layout;
};
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.cpp b/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.cpp
index b2225f2ca3..7bad24a89e 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.cpp
@@ -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);
}
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.h b/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.h
index 972e465e5a..b1e82c29fa 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.h
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyDebugging.h
@@ -6,7 +6,7 @@
#include "DolphinQt/Config/Mapping/MappingWidget.h"
-class QHBoxLayout;
+class QGridLayout;
class HotkeyDebugging final : public MappingWidget
{
@@ -22,5 +22,5 @@ private:
void CreateMainLayout();
// Main
- QHBoxLayout* m_main_layout;
+ QGridLayout* m_main_layout;
};
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.cpp b/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.cpp
index 706b6bd7ca..5ff2fe706b 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.cpp
@@ -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);
}
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.h b/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.h
index de5f450f5c..d9a8fbde05 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.h
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyGeneral.h
@@ -6,7 +6,7 @@
#include "DolphinQt/Config/Mapping/MappingWidget.h"
-class QHBoxLayout;
+class QGridLayout;
class HotkeyGeneral final : public MappingWidget
{
@@ -22,5 +22,5 @@ private:
void CreateMainLayout();
// Main
- QHBoxLayout* m_main_layout;
+ QGridLayout* m_main_layout;
};
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.cpp b/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.cpp
index 88364e6860..9114322bce 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.cpp
@@ -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);
}
diff --git a/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.h b/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.h
index fd52aa9fa8..8c172100ab 100644
--- a/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.h
+++ b/Source/Core/DolphinQt/Config/Mapping/HotkeyGraphics.h
@@ -6,7 +6,7 @@
#include "DolphinQt/Config/Mapping/MappingWidget.h"
-class QHBoxLayout;
+class QGridLayout;
class HotkeyGraphics final : public MappingWidget
{
@@ -22,5 +22,5 @@ private:
void CreateMainLayout();
// Main
- QHBoxLayout* m_main_layout;
+ QGridLayout* m_main_layout;
};
diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuExtension.cpp b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuExtension.cpp
index 9c808eae0a..5d1addfeec 100644
--- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuExtension.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuExtension.cpp
@@ -4,6 +4,7 @@
#include "DolphinQt/Config/Mapping/WiimoteEmuExtension.h"
+#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
@@ -33,43 +34,50 @@ WiimoteEmuExtension::WiimoteEmuExtension(MappingWindow* window) : MappingWidget(
void WiimoteEmuExtension::CreateClassicLayout()
{
- auto* hbox = new QHBoxLayout();
+ auto* layout = new QGridLayout();
m_classic_box = new QGroupBox(tr("Classic Controller"), this);
- hbox->addWidget(CreateGroupBox(
- tr("Buttons"), Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::Buttons)));
- hbox->addWidget(CreateGroupBox(
- tr("Left Stick"), Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::LeftStick)));
- hbox->addWidget(
+ layout->addWidget(
+ CreateGroupBox(tr("Buttons"),
+ Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::Buttons)),
+ 0, 0, -1, 1);
+ layout->addWidget(
+ CreateGroupBox(tr("Left Stick"),
+ Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::LeftStick)),
+ 0, 1, -1, 1);
+ layout->addWidget(
CreateGroupBox(tr("Right Stick"),
- Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::RightStick)));
-
- auto* vbox = new QVBoxLayout();
- vbox->addWidget(CreateGroupBox(
- tr("D-Pad"), Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::DPad)));
- vbox->addWidget(CreateGroupBox(
- tr("Triggers"), Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::Triggers)));
- hbox->addLayout(vbox);
-
- m_classic_box->setLayout(hbox);
+ Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::RightStick)),
+ 0, 2, -1, 1);
+
+ layout->addWidget(CreateGroupBox(tr("D-Pad"), Wiimote::GetClassicGroup(
+ GetPort(), WiimoteEmu::ClassicGroup::DPad)),
+ 0, 3);
+ layout->addWidget(
+ CreateGroupBox(tr("Triggers"),
+ Wiimote::GetClassicGroup(GetPort(), WiimoteEmu::ClassicGroup::Triggers)),
+ 1, 3);
+
+ m_classic_box->setLayout(layout);
}
void WiimoteEmuExtension::CreateDrumsLayout()
{
- auto* hbox = new QHBoxLayout();
+ auto* layout = new QGridLayout();
m_drums_box = new QGroupBox(tr("Drums"), this);
- hbox->addWidget(CreateGroupBox(tr("Stick"),
- Wiimote::GetDrumsGroup(GetPort(), WiimoteEmu::DrumsGroup::Stick)));
+ layout->addWidget(
+ CreateGroupBox(tr("Stick"), Wiimote::GetDrumsGroup(GetPort(), WiimoteEmu::DrumsGroup::Stick)),
+ 0, 0, -1, 1);
- auto* vbox = new QVBoxLayout();
- vbox->addWidget(
- CreateGroupBox(tr("Pads"), Wiimote::GetDrumsGroup(GetPort(), WiimoteEmu::DrumsGroup::Pads)));
- vbox->addWidget(CreateGroupBox(
- tr("Buttons"), Wiimote::GetDrumsGroup(GetPort(), WiimoteEmu::DrumsGroup::Buttons)));
- hbox->addLayout(vbox);
+ layout->addWidget(
+ CreateGroupBox(tr("Pads"), Wiimote::GetDrumsGroup(GetPort(), WiimoteEmu::DrumsGroup::Pads)),
+ 0, 1);
+ layout->addWidget(CreateGroupBox(tr("Buttons"), Wiimote::GetDrumsGroup(
+ GetPort(), WiimoteEmu::DrumsGroup::Buttons)),
+ 1, 1);
- m_drums_box->setLayout(hbox);
+ m_drums_box->setLayout(layout);
}
void WiimoteEmuExtension::CreateNoneLayout()
@@ -86,24 +94,28 @@ void WiimoteEmuExtension::CreateNoneLayout()
void WiimoteEmuExtension::CreateNunchukLayout()
{
- auto* hbox = new QHBoxLayout();
+ auto* layout = new QGridLayout();
m_nunchuk_box = new QGroupBox(tr("Nunchuk"), this);
- hbox->addWidget(CreateGroupBox(
- tr("Stick"), Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Stick)));
- hbox->addWidget(CreateGroupBox(
- tr("Tilt"), Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Tilt)));
- hbox->addWidget(CreateGroupBox(
- tr("Swing"), Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Swing)));
-
- auto* vbox = new QVBoxLayout();
- vbox->addWidget(CreateGroupBox(
- tr("Buttons"), Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Buttons)));
- vbox->addWidget(CreateGroupBox(
- tr("Shake"), Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Shake)));
- hbox->addLayout(vbox);
-
- m_nunchuk_box->setLayout(hbox);
+ layout->addWidget(CreateGroupBox(tr("Stick"), Wiimote::GetNunchukGroup(
+ GetPort(), WiimoteEmu::NunchukGroup::Stick)),
+ 0, 0, -1, 1);
+ layout->addWidget(CreateGroupBox(tr("Tilt"), Wiimote::GetNunchukGroup(
+ GetPort(), WiimoteEmu::NunchukGroup::Tilt)),
+ 0, 1, -1, 1);
+ layout->addWidget(CreateGroupBox(tr("Swing"), Wiimote::GetNunchukGroup(
+ GetPort(), WiimoteEmu::NunchukGroup::Swing)),
+ 0, 2, -1, 1);
+
+ layout->addWidget(
+ CreateGroupBox(tr("Buttons"),
+ Wiimote::GetNunchukGroup(GetPort(), WiimoteEmu::NunchukGroup::Buttons)),
+ 0, 3);
+ layout->addWidget(CreateGroupBox(tr("Shake"), Wiimote::GetNunchukGroup(
+ GetPort(), WiimoteEmu::NunchukGroup::Shake)),
+ 1, 3);
+
+ m_nunchuk_box->setLayout(layout);
}
void WiimoteEmuExtension::CreateGuitarLayout()
@@ -137,34 +149,38 @@ void WiimoteEmuExtension::CreateGuitarLayout()
void WiimoteEmuExtension::CreateTurntableLayout()
{
- auto* hbox = new QHBoxLayout();
+ auto* layout = new QGridLayout();
m_turntable_box = new QGroupBox(tr("Turntable"), this);
- hbox->addWidget(CreateGroupBox(
- tr("Stick"), Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::Stick)));
+ layout->addWidget(CreateGroupBox(tr("Stick"), Wiimote::GetTurntableGroup(
+ GetPort(), WiimoteEmu::TurntableGroup::Stick)),
+ 0, 0, -1, 1);
- auto* vbox = new QVBoxLayout();
- vbox->addWidget(CreateGroupBox(
- tr("Buttons"), Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::Buttons)));
- vbox->addWidget(CreateGroupBox(
- tr("Effect"), Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::EffectDial)));
- hbox->addLayout(vbox);
+ layout->addWidget(
+ CreateGroupBox(tr("Buttons"),
+ Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::Buttons)),
+ 0, 1);
+ layout->addWidget(
+ CreateGroupBox(tr("Effect"),
+ Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::EffectDial)),
+ 1, 1, -1, 1);
- auto* vbox2 = new QVBoxLayout();
- vbox2->addWidget(
+ layout->addWidget(
// i18n: "Table" refers to a turntable
CreateGroupBox(tr("Left Table"),
- Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::LeftTable)));
- vbox2->addWidget(CreateGroupBox(
- // i18n: "Table" refers to a turntable
- tr("Right Table"),
- Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::RightTable)));
- vbox2->addWidget(
+ Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::LeftTable)),
+ 0, 2);
+ layout->addWidget(CreateGroupBox(
+ // i18n: "Table" refers to a turntable
+ tr("Right Table"), Wiimote::GetTurntableGroup(
+ GetPort(), WiimoteEmu::TurntableGroup::RightTable)),
+ 1, 2);
+ layout->addWidget(
CreateGroupBox(tr("Crossfade"),
- Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::Crossfade)));
- hbox->addLayout(vbox2);
+ Wiimote::GetTurntableGroup(GetPort(), WiimoteEmu::TurntableGroup::Crossfade)),
+ 2, 2);
- m_turntable_box->setLayout(hbox);
+ m_turntable_box->setLayout(layout);
}
void WiimoteEmuExtension::CreateMainLayout()
diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp
index 3c34319790..466ba75667 100644
--- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp
@@ -6,9 +6,8 @@
#include <QComboBox>
#include <QFormLayout>
+#include <QGridLayout>
#include <QGroupBox>
-#include <QHBoxLayout>
-#include <QVBoxLayout>
#include "Core/HW/Wiimote.h"
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
@@ -29,16 +28,19 @@ WiimoteEmuGeneral::WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension*
void WiimoteEmuGeneral::CreateMainLayout()
{
- m_main_layout = new QHBoxLayout();
-
- auto* vbox_layout = new QVBoxLayout();
-
- m_main_layout->addWidget(CreateGroupBox(
- tr("Buttons"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Buttons)));
- m_main_layout->addWidget(CreateGroupBox(
- tr("D-Pad"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::DPad)));
- m_main_layout->addWidget(CreateGroupBox(
- tr("Hotkeys"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Hotkeys)));
+ auto* layout = new QGridLayout;
+
+ layout->addWidget(
+ CreateGroupBox(tr("Buttons"),
+ Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Buttons)),
+ 0, 0, -1, 1);
+ layout->addWidget(CreateGroupBox(tr("D-Pad"), Wiimote::GetWiimoteGroup(
+ GetPort(), WiimoteEmu::WiimoteGroup::DPad)),
+ 0, 1, -1, 1);
+ layout->addWidget(
+ CreateGroupBox(tr("Hotkeys"),
+ Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Hotkeys)),
+ 0, 2, -1, 1);
auto* extension_group =
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Attachments);
@@ -56,16 +58,17 @@ void WiimoteEmuGeneral::CreateMainLayout()
static_cast<QFormLayout*>(extension->layout())->addRow(m_extension_combo);
- vbox_layout->addWidget(extension);
- vbox_layout->addWidget(CreateGroupBox(
- tr("Rumble"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Rumble)));
-
- vbox_layout->addWidget(CreateGroupBox(
- tr("Options"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Options)));
+ layout->addWidget(extension, 0, 3);
+ layout->addWidget(CreateGroupBox(tr("Rumble"), Wiimote::GetWiimoteGroup(
+ GetPort(), WiimoteEmu::WiimoteGroup::Rumble)),
+ 1, 3);
- m_main_layout->addLayout(vbox_layout);
+ layout->addWidget(
+ CreateGroupBox(tr("Options"),
+ Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Options)),
+ 2, 3);
- setLayout(m_main_layout);
+ setLayout(layout);
}
void WiimoteEmuGeneral::Connect(MappingWindow* window)
diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h
index aa6dd3a5f5..ad346aabf3 100644
--- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h
+++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h
@@ -7,7 +7,6 @@
#include "DolphinQt/Config/Mapping/MappingWidget.h"
class QComboBox;
-class QHBoxLayout;
class WiimoteEmuExtension;
class WiimoteEmuGeneral final : public MappingWidget
@@ -26,9 +25,6 @@ private:
void OnAttachmentChanged(int index);
void Update();
- // Main
- QHBoxLayout* m_main_layout;
-
// Extensions
QComboBox* m_extension_combo;