Permalink
Browse files

Qt/GraphicsControls: Reload values when settings are changed

  • Loading branch information...
spycrab committed Apr 29, 2018
1 parent e51cf88 commit 417d191c9e01358e7315ea9722b3bef1a57bde31
@@ -20,6 +20,7 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo<bool>&
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
setChecked(Config::Get(m_setting) ^ m_reverse);
});
}
@@ -19,6 +19,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
setCurrentIndex(Config::Get(m_setting));
});
}
@@ -13,6 +13,13 @@ GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::ConfigInf
{
setChecked(Config::Get(m_setting) == m_value);
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()
@@ -23,6 +23,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInf
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
setValue(Config::Get(m_setting));
});
}

0 comments on commit 417d191

Please sign in to comment.