From 908e1e9abaf0bab44acb999f37bd472ec007488c Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 16 Jun 2017 01:42:12 +0200 Subject: Qt: Implement graphics window and controls --- .../DolphinQt2/Config/Graphics/GraphicsChoice.cpp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp (limited to 'Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp') 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& setting) + : m_setting(setting) +{ + addItems(options); + connect(this, static_cast(&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); +} -- cgit v1.2.3