aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/ThemeCustomizationWidget.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-07-27 00:05:59 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-07-27 00:05:59 +0300
commit3c472fd7e0cbe517c63f41f8c02767e372e916a1 (patch)
tree3ae2752ae0b5991401737b2402b47a9131c2e5c6 /launcher/ui/widgets/ThemeCustomizationWidget.cpp
parent477b72ad33c29de097585ed415e1940cc25e2b34 (diff)
parentd960effb994ba421c502d8d5e0a1bb4d46efd9a3 (diff)
downloadPrismLauncher-3c472fd7e0cbe517c63f41f8c02767e372e916a1.tar.gz
PrismLauncher-3c472fd7e0cbe517c63f41f8c02767e372e916a1.tar.bz2
PrismLauncher-3c472fd7e0cbe517c63f41f8c02767e372e916a1.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into prism_export2
Diffstat (limited to 'launcher/ui/widgets/ThemeCustomizationWidget.cpp')
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
index 3bfcd821..291f8ed9 100644
--- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp
+++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
@@ -95,9 +95,14 @@ void ThemeCustomizationWidget::applyWidgetTheme(int index) {
emit currentWidgetThemeChanged(index);
}
-void ThemeCustomizationWidget::applyCatTheme(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);
}
@@ -135,10 +140,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);
}
}