Merge pull request #7217 from Techjar/qt-clock-speed-slider

Qt/AdvancedPane: Fix CPU clock slider not updating on emulation state change
This commit is contained in:
spycrab 2018-07-05 22:48:21 +02:00 committed by GitHub
commit fbf445154b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -104,8 +104,6 @@ void AdvancedPane::ConnectLayout()
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) {
// Vaguely exponential scaling?
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_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([] {
int core_clock = SystemTimers::GetTicksPerSecond() / std::pow(10, 6);
int percent = static_cast<int>(std::round(SConfig::GetInstance().m_OCFactor * 100.f));