Merge pull request #6717 from spycrab/issue_11039

Qt/GraphicsControls: Reload values when settings are changed
This commit is contained in:
Mat M 2018-04-29 20:20:36 -04:00 committed by GitHub
commit ad836b9071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo<bool>&
QFont bf = font(); QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf); setFont(bf);
setChecked(Config::Get(m_setting) ^ m_reverse);
}); });
} }

View File

@ -19,6 +19,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI
QFont bf = font(); QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf); setFont(bf);
setCurrentIndex(Config::Get(m_setting));
}); });
} }

View File

@ -13,6 +13,13 @@ GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::ConfigInf
{ {
setChecked(Config::Get(m_setting) == m_value); setChecked(Config::Get(m_setting) == m_value);
connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update); connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
setChecked(Config::Get(m_setting) == m_value);
});
} }
void GraphicsRadioInt::Update() void GraphicsRadioInt::Update()

View File

@ -23,6 +23,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInf
QFont bf = font(); QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base); bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf); setFont(bf);
setValue(Config::Get(m_setting));
}); });
} }