diff --git a/rpcs3/rpcs3qt/gui_application.cpp b/rpcs3/rpcs3qt/gui_application.cpp index 51b3219fd4..02e55416e3 100644 --- a/rpcs3/rpcs3qt/gui_application.cpp +++ b/rpcs3/rpcs3qt/gui_application.cpp @@ -161,15 +161,6 @@ bool gui_application::Init() { welcome_dialog* welcome = new welcome_dialog(m_gui_settings, false); - connect(welcome, &QDialog::finished, this, [&]() - { - if (welcome->use_dark_theme()) - { - m_gui_settings->SetValue(gui::m_currentStylesheet, gui::DarkStylesheet); - } - }); - - // welcome dialog is auto-flagged (in its constructor) as WA_DeleteOnClose, so its pointer is no more usable after welcome->exec() welcome->exec(); } diff --git a/rpcs3/rpcs3qt/welcome_dialog.cpp b/rpcs3/rpcs3qt/welcome_dialog.cpp index ebbd1c26c4..00860f58a5 100644 --- a/rpcs3/rpcs3qt/welcome_dialog.cpp +++ b/rpcs3/rpcs3qt/welcome_dialog.cpp @@ -15,7 +15,6 @@ welcome_dialog::welcome_dialog(std::shared_ptr gui_settings, bool : QDialog(parent) , ui(new Ui::welcome_dialog) , m_gui_settings(std::move(gui_settings)) - , m_use_dark_theme(gui::utils::dark_mode_active()) { ui->setupUi(this); @@ -28,7 +27,7 @@ welcome_dialog::welcome_dialog(std::shared_ptr gui_settings, bool ui->do_not_show->setEnabled(!is_manual_show); ui->do_not_show->setChecked(!m_gui_settings->GetValue(gui::ib_show_welcome).toBool()); ui->use_dark_theme->setEnabled(!is_manual_show); - ui->use_dark_theme->setChecked(m_use_dark_theme); + ui->use_dark_theme->setChecked(gui::utils::dark_mode_active()); ui->icon_label->load(QStringLiteral(":/rpcs3.svg")); ui->label_3->setText(tr( R"( @@ -90,7 +89,10 @@ welcome_dialog::welcome_dialog(std::shared_ptr gui_settings, bool gui::utils::create_shortcut("RPCS3", "", "", "RPCS3", ":/rpcs3.svg", fs::get_temp_dir(), gui::utils::shortcut_location::applications); } - m_use_dark_theme = ui->use_dark_theme->isChecked(); + if (ui->use_dark_theme->isChecked() && ui->use_dark_theme->isEnabled()) // if checked and also on initial welcome dialog + { + m_gui_settings->SetValue(gui::m_currentStylesheet, gui::DarkStylesheet); + } }); } diff --git a/rpcs3/rpcs3qt/welcome_dialog.h b/rpcs3/rpcs3qt/welcome_dialog.h index a2cf293def..3f04cfdb9f 100644 --- a/rpcs3/rpcs3qt/welcome_dialog.h +++ b/rpcs3/rpcs3qt/welcome_dialog.h @@ -17,12 +17,7 @@ public: explicit welcome_dialog(std::shared_ptr gui_settings, bool is_manual_show, QWidget* parent = nullptr); ~welcome_dialog(); - bool use_dark_theme() const - { - return m_use_dark_theme; - } private: std::unique_ptr ui; std::shared_ptr m_gui_settings; - bool m_use_dark_theme; };