Skip to content

Commit

Permalink
Merge pull request #6081 from ligfx/graphicsuseconfigchanged
Browse files Browse the repository at this point in the history
Qt: bold graphics settings on ConfigChanged, not EmulationStateChanged
  • Loading branch information
leoetlino committed Sep 25, 2017
2 parents 38a8d04 + 9245210 commit faced47
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt2/Config/Graphics/GraphicsBool.cpp
Expand Up @@ -16,7 +16,7 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo<bool>&
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
setChecked(Config::Get(m_setting) ^ reverse);

connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() {
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.cpp
Expand Up @@ -15,7 +15,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI
&GraphicsChoice::Update);
setCurrentIndex(Config::Get(m_setting));

connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() {
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.cpp
Expand Up @@ -19,7 +19,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInf

connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update);

connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this]() {
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/DolphinQt2/Settings.cpp
Expand Up @@ -7,12 +7,14 @@
#include <QSize>

#include "AudioCommon/AudioCommon.h"
#include "Common/Config/Config.h"
#include "Common/FileSearch.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt2/GameList/GameListModel.h"
#include "DolphinQt2/QtUtils/QueueOnObject.h"
#include "DolphinQt2/Settings.h"
#include "InputCommon/InputConfig.h"

Expand All @@ -21,6 +23,9 @@ Settings::Settings()
qRegisterMetaType<Core::State>();
Core::SetOnStateChangedCallback(
[this](Core::State new_state) { emit EmulationStateChanged(new_state); });

Config::AddConfigChangedCallback(
[this] { QueueOnObject(this, [this] { emit ConfigChanged(); }); });
}

Settings& Settings::Instance()
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinQt2/Settings.h
Expand Up @@ -81,6 +81,7 @@ class Settings final : public QObject
GameListModel* GetGameListModel() const;

signals:
void ConfigChanged();
void EmulationStateChanged(Core::State new_state);
void ThemeChanged();
void PathAdded(const QString&);
Expand Down

0 comments on commit faced47

Please sign in to comment.