Merge pull request #6081 from ligfx/graphicsuseconfigchanged

Qt: bold graphics settings on ConfigChanged, not EmulationStateChanged
This commit is contained in:
Leo Lam 2017-09-25 21:53:27 +02:00 committed by GitHub
commit faced475df
5 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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"
@ -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()

View File

@ -81,6 +81,7 @@ public:
GameListModel* GetGameListModel() const;
signals:
void ConfigChanged();
void EmulationStateChanged(Core::State new_state);
void ThemeChanged();
void PathAdded(const QString&);