summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-28 12:05:00 -0700
committerGitHub <noreply@github.com>2017-06-28 12:05:00 -0700
commitc29c1f92af12eed0c90fbf81dfb69dd47510a668 (patch)
treeafa961e9e3afde6e209e8beec4506b95e5db8057 /Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp
parente14a82a87ee1b3d32a13736a0224b8247f6195f4 (diff)
parent4d37190327366a152951306fadfffa6c24893759 (diff)
Merge pull request #5615 from spycrab/qt_graphics
Qt: Implement graphics window
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp
new file mode 100644
index 0000000000..9fbc537894
--- /dev/null
+++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp
@@ -0,0 +1,28 @@
+// Copyright 2017 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "DolphinQt2/Config/Graphics/GraphicsChoice.h"
+
+#include "Core/Config/Config.h"
+
+GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigInfo<int>& setting)
+ : m_setting(setting)
+{
+ addItems(options);
+ connect(this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
+ &GraphicsChoice::Update);
+ setCurrentIndex(Config::Get(m_setting));
+
+ if (Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base)
+ {
+ QFont bf = font();
+ bf.setBold(true);
+ setFont(bf);
+ }
+}
+
+void GraphicsChoice::Update(int choice)
+{
+ Config::SetBaseOrCurrent(m_setting, choice);
+}