1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

Qt: some cleanup

This commit is contained in:
Megamouse 2020-04-20 23:43:23 +02:00
parent 1a374126e1
commit 18e0b83ac9
2 changed files with 18 additions and 15 deletions

View File

@ -54,11 +54,10 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
ui->tab_widget_settings->setUsesScrollButtons(false);
ui->tab_widget_settings->tabBar()->setObjectName("tab_bar_settings");
const bool show_debug_tab = m_gui_settings->GetValue(gui::m_showDebugTab).toBool();
m_gui_settings->SetValue(gui::m_showDebugTab, show_debug_tab);
if (!show_debug_tab)
if (!m_gui_settings->GetValue(gui::m_showDebugTab).toBool())
{
ui->tab_widget_settings->removeTab(9);
m_gui_settings->SetValue(gui::m_showDebugTab, false);
}
if (game)
{
@ -1870,7 +1869,7 @@ int settings_dialog::exec()
// switch to the cpu tab after conjuring the settings_dialog with another tab opened first.
// Weirdly enough this won't happen if we change the tab order so that anything else is at index 0.
ui->tab_widget_settings->setCurrentIndex(0);
QTimer::singleShot(0, [=, this]{ ui->tab_widget_settings->setCurrentIndex(m_tab_index); });
QTimer::singleShot(0, [this]{ ui->tab_widget_settings->setCurrentIndex(m_tab_index); });
// Open a dialog if your config file contained invalid entries
QTimer::singleShot(10, [this] { m_emu_settings->OpenCorrectionDialog(this); });
@ -1901,16 +1900,23 @@ bool settings_dialog::eventFilter(QObject* object, QEvent* event)
if (event->type() == QEvent::Enter || event->type() == QEvent::Leave)
{
const int i = ui->tab_widget_settings->currentIndex();
QLabel* label = m_description_labels[i].first;
if (event->type() == QEvent::Enter)
if (i < m_description_labels.size())
{
label->setText(m_descriptions[object]);
}
else if (event->type() == QEvent::Leave)
{
const QString description = m_description_labels[i].second;
label->setText(description);
QLabel* label = m_description_labels[i].first;
if (label)
{
if (event->type() == QEvent::Enter)
{
label->setText(m_descriptions[object]);
}
else if (event->type() == QEvent::Leave)
{
const QString description = m_description_labels[i].second;
label->setText(description);
}
}
}
}

View File

@ -35,9 +35,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="coreTab">
<attribute name="title">
<string>CPU</string>