summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-07-18 22:17:13 +1000
committerGitHub <noreply@github.com>2019-07-18 22:17:13 +1000
commita77b571da7a31fe30f35605a90d040325cb1e595 (patch)
treefb84b694c9028d47b15d36ff315ab6f518d02072 /Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp
parent9dd8f82e78648a34bf3246dea6758215b7224aff (diff)
parent199c565bf5fec9ba0f239a4ec8585914c3df4b9d (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.cpp39
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);
+}