Merge pull request #6078 from spycrab/qt_fix_bold
Qt/GraphicsSettings: Fix overriden settings not being bolded
This commit is contained in:
commit
10b3f02385
|
@ -5,6 +5,7 @@
|
|||
#include "DolphinQt2/Config/Graphics/GraphicsBool.h"
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
|
||||
#include <QFont>
|
||||
|
||||
|
@ -15,12 +16,11 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo<bool>&
|
|||
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()
|
||||
|
|
|
@ -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<int>& setting)
|
||||
: m_setting(setting)
|
||||
|
@ -14,12 +15,14 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI
|
|||
&GraphicsChoice::Update);
|
||||
setCurrentIndex(Config::Get(m_setting));
|
||||
|
||||
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)
|
||||
|
|
|
@ -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<int>& 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)
|
||||
|
|
Loading…
Reference in New Issue