From 6c7e392f0c6b8b9dcca2f22060cf823a173552a5 Mon Sep 17 00:00:00 2001 From: spycrab Date: Wed, 20 Sep 2017 13:34:24 +0200 Subject: [PATCH] Qt/GraphicsSettings: Fix overriden settings not being bolded --- .../DolphinQt2/Config/Graphics/GraphicsBool.cpp | 8 ++++---- .../DolphinQt2/Config/Graphics/GraphicsChoice.cpp | 15 +++++++++------ .../DolphinQt2/Config/Graphics/GraphicsSlider.cpp | 7 +++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsBool.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsBool.cpp index e05e9d94c0..25d390be19 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsBool.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsBool.cpp @@ -5,6 +5,7 @@ #include "DolphinQt2/Config/Graphics/GraphicsBool.h" #include "Common/Config/Config.h" +#include "DolphinQt2/Settings.h" #include @@ -15,12 +16,11 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo& connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update); setChecked(Config::Get(m_setting) ^ reverse); - if (Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base) - { + connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() { QFont bf = font(); - bf.setBold(true); + bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); setFont(bf); - } + }); } void GraphicsBool::Update() diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp index 65546ed718..ccc8d4a9fb 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp @@ -5,6 +5,7 @@ #include "DolphinQt2/Config/Graphics/GraphicsChoice.h" #include "Common/Config/Config.h" +#include "DolphinQt2/Settings.h" GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigInfo& setting) : m_setting(setting) @@ -14,12 +15,14 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI &GraphicsChoice::Update); setCurrentIndex(Config::Get(m_setting)); - if (Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base) - { - QFont bf = font(); - bf.setBold(true); - setFont(bf); - } + connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() { + if (Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base) + { + QFont bf = font(); + bf.setBold(true); + setFont(bf); + } + }); } void GraphicsChoice::Update(int choice) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.cpp index e78be6eb82..0e40e4164d 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.cpp @@ -5,6 +5,7 @@ #include "DolphinQt2/Config/Graphics/GraphicsSlider.h" #include "Common/Config/Config.h" +#include "DolphinQt2/Settings.h" GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInfo& setting, int tick) @@ -17,6 +18,12 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInf setValue(Config::Get(setting)); connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update); + + connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() { + QFont bf = font(); + bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); + setFont(bf); + }); } void GraphicsSlider::Update(int value)