diff options
| author | JosJuice <josjuice@gmail.com> | 2019-07-17 20:15:25 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2019-07-18 12:20:21 +0200 |
| commit | 199c565bf5fec9ba0f239a4ec8585914c3df4b9d (patch) | |
| tree | ee537bb65467d2ccce33fd613ebef1c6c9018375 /Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp | |
| parent | a6dcaed415197a243b5af3353ea6371a5759a273 (diff) | |
DolphinQt: Add the dumping bitrate setting to the graphics config
Fixes https://bugs.dolphin-emu.org/issues/10250
Diffstat (limited to 'Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp new file mode 100644 index 0000000000..cabca80d52 --- /dev/null +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp @@ -0,0 +1,39 @@ +// Copyright 2019 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "DolphinQt/Config/Graphics/GraphicsInteger.h" + +#include <QSignalBlocker> + +#include "Common/Config/Config.h" + +#include "DolphinQt/Settings.h" + +GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::ConfigInfo<int>& setting, + int step) + : QSpinBox(), m_setting(setting) +{ + setMinimum(minimum); + setMaximum(maximum); + setSingleStep(step); + + setValue(Config::Get(setting)); + + connect(this, static_cast<void (GraphicsInteger::*)(int)>(&GraphicsInteger::valueChanged), this, + &GraphicsInteger::Update); + + connect(&Settings::Instance(), &Settings::ConfigChanged, [this] { + QFont bf = font(); + bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); + setFont(bf); + + const QSignalBlocker blocker(this); + setValue(Config::Get(m_setting)); + }); +} + +void GraphicsInteger::Update(int value) +{ + Config::SetBaseOrCurrent(m_setting, value); +} |
