diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-07-18 22:17:13 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-18 22:17:13 +1000 |
| commit | a77b571da7a31fe30f35605a90d040325cb1e595 (patch) | |
| tree | fb84b694c9028d47b15d36ff315ab6f518d02072 /Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp | |
| parent | 9dd8f82e78648a34bf3246dea6758215b7224aff (diff) | |
| parent | 199c565bf5fec9ba0f239a4ec8585914c3df4b9d (diff) | |
Merge pull request #8250 from JosJuice/bitrate-setting
Add dumping bitrate setting to GUI and increase default value
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); +} |
