Merge pull request #7311 from master0fdisaster/test2

Qt/Settings: Minor Fixes
This commit is contained in:
spycrab 2018-08-14 17:42:21 +02:00 committed by GitHub
commit 0626c230a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -139,7 +139,7 @@ void AdvancedPane::Update()
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)));
static_cast<int>(std::round(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);

View File

@ -6,6 +6,7 @@
#include <QCheckBox>
#include <QComboBox>
#include <QFileInfo>
#include <QFormLayout>
#include <QGroupBox>
#include <QLabel>
@ -199,6 +200,7 @@ void InterfacePane::ConnectLayout()
&InterfacePane::OnSaveConfig);
connect(m_checkbox_confirm_on_stop, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_use_panic_handlers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_show_active_title, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_enable_osd, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_pause_on_focus_lost, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_hide_mouse, &QCheckBox::toggled, &Settings::Instance(),
@ -218,11 +220,10 @@ void InterfacePane::LoadConfig()
m_combobox_theme->findText(QString::fromStdString(SConfig::GetInstance().theme_name)));
const QString userstyle = Settings::Instance().GetCurrentUserStyle();
const int index = m_combobox_userstyle->findText(QFileInfo(userstyle).baseName());
if (userstyle.isEmpty())
m_combobox_userstyle->setCurrentIndex(0);
else
m_combobox_userstyle->setCurrentText(userstyle);
if (index > 0)
m_combobox_userstyle->setCurrentIndex(index);
m_checkbox_use_userstyle->setChecked(Settings::Instance().AreUserStylesEnabled());
@ -247,8 +248,8 @@ void InterfacePane::OnSaveConfig()
Settings::Instance().SetKeepWindowOnTop(m_checkbox_top_window->isChecked());
settings.m_use_builtin_title_database = m_checkbox_use_builtin_title_database->isChecked();
Settings::Instance().SetDebugModeEnabled(m_checkbox_show_debugging_ui->isChecked());
Settings::Instance().SetCurrentUserStyle(m_combobox_userstyle->currentData().toString());
Settings::Instance().SetUserStylesEnabled(m_checkbox_use_userstyle->isChecked());
Settings::Instance().SetCurrentUserStyle(m_combobox_userstyle->currentData().toString());
const bool visible = m_checkbox_use_userstyle->isChecked();