diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-07-21 12:48:05 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-07-21 12:48:05 +0100 |
commit | f8b935ab37ccc2dfd70412ef11029b79c88b14f0 (patch) | |
tree | cbe799ada6c0ce1040cf60d2da2ab7c4cfdfbb13 /launcher/ui/widgets | |
parent | 5088d33fd2aec8fed9725f9dedb64e9629226c11 (diff) | |
parent | 821dd8400b1a27ab1f932200bfa77d7a04edef5d (diff) | |
download | PrismLauncher-f8b935ab37ccc2dfd70412ef11029b79c88b14f0.tar.gz PrismLauncher-f8b935ab37ccc2dfd70412ef11029b79c88b14f0.tar.bz2 PrismLauncher-f8b935ab37ccc2dfd70412ef11029b79c88b14f0.zip |
Merge remote-tracking branch 'upstream/develop' into icon-indexing
Diffstat (limited to 'launcher/ui/widgets')
-rw-r--r-- | launcher/ui/widgets/ThemeCustomizationWidget.cpp | 14 | ||||
-rw-r--r-- | launcher/ui/widgets/ThemeCustomizationWidget.h | 7 |
2 files changed, 9 insertions, 12 deletions
diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp index 106a9ca3..8ccb5dcc 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp +++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp @@ -105,7 +105,11 @@ void ThemeCustomizationWidget::applyWidgetTheme(int index) void ThemeCustomizationWidget::applyCatTheme(int index) { auto settings = APPLICATION->settings(); - settings->set("BackgroundCat", m_catOptions[index].first); + auto originalCat = settings->get("BackgroundCat").toString(); + auto newCat = ui->backgroundCatComboBox->currentData().toString(); + if (originalCat != newCat) { + settings->set("BackgroundCat", newCat); + } emit currentCatChanged(index); } @@ -148,10 +152,10 @@ void ThemeCustomizationWidget::loadSettings() } auto cat = settings->get("BackgroundCat").toString(); - for (auto& catFromList : m_catOptions) { - QIcon catIcon = QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first))); - ui->backgroundCatComboBox->addItem(catIcon, catFromList.second); - if (cat == catFromList.first) { + for (auto& catFromList : APPLICATION->getValidCatPacks()) { + QIcon catIcon = QIcon(QString("%1").arg(catFromList->path())); + ui->backgroundCatComboBox->addItem(catIcon, catFromList->name(), catFromList->id()); + if (cat == catFromList->id()) { ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1); } } diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.h b/launcher/ui/widgets/ThemeCustomizationWidget.h index 976ede43..cef5fb6c 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.h +++ b/launcher/ui/widgets/ThemeCustomizationWidget.h @@ -52,11 +52,4 @@ class ThemeCustomizationWidget : public QWidget { private: Ui::ThemeCustomizationWidget* ui; - - QList<std::pair<QString, QString>> m_catOptions{ - { "kitteh", QObject::tr("Background Cat (from MultiMC)") }, - { "rory", QObject::tr("Rory ID 11 (drawn by Ashtaka)") }, - { "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") }, - { "teawie", QObject::tr("Teawie (drawn by SympathyTea)") } - }; }; |