diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index d9cad64e18..cb64cccafd 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -88,10 +88,10 @@ MainWindow::~MainWindow() void MainWindow::initialize() { - setIconThemeFromSettings(); + setStyleFromSettings(); + setIconThemeFromStyle(); m_ui.setupUi(this); setupAdditionalUi(); - setStyleFromSettings(); connectSignals(); connectVMThreadSignals(g_emu_thread); @@ -549,17 +549,11 @@ void MainWindow::setStyleFromSettings() } } -void MainWindow::setIconThemeFromSettings() +void MainWindow::setIconThemeFromStyle() { - const std::string theme(Host::GetBaseStringSettingValue("UI", "Theme", DEFAULT_THEME_NAME)); - QString icon_theme; - - if (theme == "darkfusion" || theme == "darkfusionblue" || theme == "dualtoneOrangeBlue" || theme == "ScarletDevilRed") - icon_theme = QStringLiteral("white"); - else - icon_theme = QStringLiteral("black"); - - QIcon::setThemeName(icon_theme); + QPalette palette = qApp->palette(); + bool dark = palette.windowText().color().value() > palette.window().color().value(); + QIcon::setThemeName(dark ? QStringLiteral("white") : QStringLiteral("black")); } void MainWindow::onScreenshotActionTriggered() @@ -1219,7 +1213,7 @@ void MainWindow::onToolsOpenDataDirectoryTriggered() void MainWindow::onThemeChanged() { setStyleFromSettings(); - setIconThemeFromSettings(); + setIconThemeFromStyle(); recreate(); } diff --git a/pcsx2-qt/MainWindow.h b/pcsx2-qt/MainWindow.h index 706ada6b84..1ae4082aeb 100644 --- a/pcsx2-qt/MainWindow.h +++ b/pcsx2-qt/MainWindow.h @@ -169,7 +169,7 @@ private: void setupAdditionalUi(); void connectSignals(); void setStyleFromSettings(); - void setIconThemeFromSettings(); + void setIconThemeFromStyle(); void saveStateToConfig(); void restoreStateFromConfig();