| 1 | // Copyright 2017 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/Config/Mapping/HotkeyGraphics.h" |
| 5 | |
| 6 | #include <QGridLayout> |
| 7 | #include <QGroupBox> |
| 8 | |
| 9 | #include "Core/HotkeyManager.h" |
| 10 | |
| 11 | HotkeyGraphics::HotkeyGraphics(MappingWindow* window) : MappingWidget(window) |
| 12 | { |
| 13 | CreateMainLayout(); |
| 14 | } |
| 15 | |
| 16 | void HotkeyGraphics::CreateMainLayout() |
| 17 | { |
| 18 | m_main_layout = new QGridLayout(); |
| 19 | |
| 20 | m_main_layout->addWidget(CreateGroupBox(tr("Graphics Toggles"), |
| 21 | HotkeyManagerEmu::GetHotkeyGroup(HKGP_GRAPHICS_TOGGLES)), |
| 22 | 0, 0, -1, 1); |
| 23 | |
| 24 | m_main_layout->addWidget( |
| 25 | CreateGroupBox(tr("FreeLook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK)), 0, 1); |
| 26 | m_main_layout->addWidget( |
| 27 | CreateGroupBox(tr("Internal Resolution"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_IR)), 1, 1); |
| 28 | |
| 29 | setLayout(m_main_layout); |
| 30 | } |
| 31 | |
| 32 | InputConfig* HotkeyGraphics::GetConfig() |
| 33 | { |
| 34 | return HotkeyManagerEmu::GetConfig(); |
| 35 | } |
| 36 | |
| 37 | void HotkeyGraphics::LoadSettings() |
| 38 | { |
| 39 | HotkeyManagerEmu::LoadConfig(); |
| 40 | } |
| 41 | |
| 42 | void HotkeyGraphics::SaveSettings() |
| 43 | { |
| 44 | HotkeyManagerEmu::GetConfig()->SaveConfig(); |
| 45 | } |