Qt/AdvancedPane: Fix CPU clock slider not updating on emulation state change

This commit is contained in:
Techjar 2018-07-05 15:20:29 -04:00
parent fd83937987
commit cd8e3efb21
1 changed files with 3 additions and 2 deletions

View File

@ -104,8 +104,6 @@ void AdvancedPane::ConnectLayout()
Update(); Update();
}); });
m_cpu_clock_override_slider->setValue(
static_cast<int>(std::ceil(std::log2f(SConfig::GetInstance().m_OCFactor) * 25.f + 100.f)));
connect(m_cpu_clock_override_slider, &QSlider::valueChanged, [this](int oc_factor) { connect(m_cpu_clock_override_slider, &QSlider::valueChanged, [this](int oc_factor) {
// Vaguely exponential scaling? // Vaguely exponential scaling?
SConfig::GetInstance().m_OCFactor = SConfig::GetInstance().m_OCFactor =
@ -137,6 +135,9 @@ void AdvancedPane::Update()
m_cpu_clock_override_slider->setEnabled(enable_cpu_clock_override_widgets); m_cpu_clock_override_slider->setEnabled(enable_cpu_clock_override_widgets);
m_cpu_clock_override_slider_label->setEnabled(enable_cpu_clock_override_widgets); m_cpu_clock_override_slider_label->setEnabled(enable_cpu_clock_override_widgets);
m_cpu_clock_override_slider->setValue(
static_cast<int>(std::ceil(std::log2f(SConfig::GetInstance().m_OCFactor) * 25.f + 100.f)));
m_cpu_clock_override_slider_label->setText([] { m_cpu_clock_override_slider_label->setText([] {
int core_clock = SystemTimers::GetTicksPerSecond() / std::pow(10, 6); int core_clock = SystemTimers::GetTicksPerSecond() / std::pow(10, 6);
int percent = static_cast<int>(std::round(SConfig::GetInstance().m_OCFactor * 100.f)); int percent = static_cast<int>(std::round(SConfig::GetInstance().m_OCFactor * 100.f));