diff --git a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp index 8cfc1d0d5c..eb906c9ed7 100644 --- a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp @@ -11,6 +11,7 @@ #include #include "DolphinQt2/Config/SettingsWindow.h" +#include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" #include "DolphinQt2/Settings/GeneralPane.h" #include "DolphinQt2/Settings/InterfacePane.h" @@ -75,15 +76,18 @@ void SettingsWindow::MakeUnfinishedWarning() m_warning_group->setLayout(m_warning_group_layout); } -void SettingsWindow::AddCategoryToList(const QString& title, const QString& icon) +void SettingsWindow::AddCategoryToList(const QString& title, const std::string& icon_name) { QString dir = Settings::Instance().GetThemeDir(); QListWidgetItem* button = new QListWidgetItem(); - button->setIcon(QIcon(dir.append(icon))); button->setText(title); button->setTextAlignment(Qt::AlignVCenter); button->setSizeHint(QSize(28, 28)); button->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + + auto set_icon = [=] { button->setIcon(Resources::GetScaledThemeIcon(icon_name)); }; + QObject::connect(&Settings::Instance(), &Settings::ThemeChanged, set_icon); + set_icon(); m_categories->addItem(button); } @@ -95,9 +99,9 @@ void SettingsWindow::MakeCategoryList() m_categories->setMovement(QListView::Static); m_categories->setSpacing(0); - AddCategoryToList(tr("General"), QStringLiteral("config.png")); - AddCategoryToList(tr("Interface"), QStringLiteral("browse.png")); - AddCategoryToList(tr("Paths"), QStringLiteral("browse.png")); + AddCategoryToList(tr("General"), "config"); + AddCategoryToList(tr("Interface"), "browse"); + AddCategoryToList(tr("Paths"), "browse"); connect(m_categories, &QListWidget::currentItemChanged, this, &SettingsWindow::changePage); } diff --git a/Source/Core/DolphinQt2/Config/SettingsWindow.h b/Source/Core/DolphinQt2/Config/SettingsWindow.h index 00c1c227c1..d83400791b 100644 --- a/Source/Core/DolphinQt2/Config/SettingsWindow.h +++ b/Source/Core/DolphinQt2/Config/SettingsWindow.h @@ -4,6 +4,8 @@ #pragma once +#include + #include class QGroupBox; @@ -23,7 +25,7 @@ public slots: private: void MakeCategoryList(); void MakeUnfinishedWarning(); - void AddCategoryToList(const QString& title, const QString& icon); + void AddCategoryToList(const QString& title, const std::string& icon_name); void SetupSettingsWidget(); QStackedWidget* m_settings_outer; QListWidget* m_categories;