From 668b19d11948bedeff6908d76d63f5a5fad4eb02 Mon Sep 17 00:00:00 2001 From: Tayou Date: Mon, 9 Jan 2023 18:40:58 +0100 Subject: [PATCH] Add hint about Cat Signed-off-by: Tayou --- launcher/ui/setupwizard/ThemeWizardPage.ui | 15 +++++- .../ui/widgets/ThemeCustomizationWidget.cpp | 14 ++--- .../ui/widgets/ThemeCustomizationWidget.h | 2 +- .../ui/widgets/ThemeCustomizationWidget.ui | 51 ++++++++++++++----- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/launcher/ui/setupwizard/ThemeWizardPage.ui b/launcher/ui/setupwizard/ThemeWizardPage.ui index 1ab04fc8..01394ea4 100644 --- a/launcher/ui/setupwizard/ThemeWizardPage.ui +++ b/launcher/ui/setupwizard/ThemeWizardPage.ui @@ -31,6 +31,16 @@ + + + + Hint: The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar. + + + true + + + @@ -41,7 +51,7 @@ - Icon Preview: + Preview: @@ -317,6 +327,9 @@ 256 + + The cat appears in the background and does not serve a purpose, it is purely visual. + diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp index d0b5be21..dcf13303 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp +++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp @@ -72,10 +72,11 @@ void ThemeCustomizationWidget::showFeatures(ThemeFields features) { void ThemeCustomizationWidget::applyIconTheme(int index) { auto settings = APPLICATION->settings(); - auto original = settings->get("IconTheme").toString(); - settings->set("IconTheme", m_iconThemeOptions[index].first); + auto originalIconTheme = settings->get("IconTheme").toString(); + auto& newIconTheme = m_iconThemeOptions[index].first; + settings->set("IconTheme", newIconTheme); - if (original != settings->get("IconTheme")) { + if (originalIconTheme != newIconTheme) { APPLICATION->applyCurrentlySelectedTheme(); } @@ -113,7 +114,8 @@ void ThemeCustomizationWidget::loadSettings() auto iconTheme = settings->get("IconTheme").toString(); for (auto& iconThemeFromList : m_iconThemeOptions) { - ui->iconsComboBox->addItem(QIcon(QString(":/icons/%1/scalable/settings").arg(iconThemeFromList.first)), iconThemeFromList.second); + QIcon iconForComboBox = QIcon(QString(":/icons/%1/scalable/settings").arg(iconThemeFromList.first)); + ui->iconsComboBox->addItem(iconForComboBox, iconThemeFromList.second); if (iconTheme == iconThemeFromList.first) { ui->iconsComboBox->setCurrentIndex(ui->iconsComboBox->count() - 1); } @@ -134,8 +136,8 @@ void ThemeCustomizationWidget::loadSettings() auto cat = settings->get("BackgroundCat").toString(); for (auto& catFromList : m_catOptions) { - ui->backgroundCatComboBox->addItem(QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first))), - catFromList.second); + QIcon catIcon = QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first))); + ui->backgroundCatComboBox->addItem(catIcon, catFromList.second); if (cat == catFromList.first) { ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1); } diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.h b/launcher/ui/widgets/ThemeCustomizationWidget.h index be2c4492..d955a266 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.h +++ b/launcher/ui/widgets/ThemeCustomizationWidget.h @@ -74,4 +74,4 @@ class ThemeCustomizationWidget : public QWidget { { "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") }, { "teawie", QObject::tr("Teawie (drawn by SympathyTea)") } }; -}; \ No newline at end of file +}; diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.ui b/launcher/ui/widgets/ThemeCustomizationWidget.ui index b2772983..f216a610 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.ui +++ b/launcher/ui/widgets/ThemeCustomizationWidget.ui @@ -7,7 +7,7 @@ 0 0 400 - 311 + 191 @@ -77,6 +77,9 @@ + + The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar. + C&at @@ -86,17 +89,41 @@ - - - - 0 - 0 - - - - Qt::StrongFocus - - + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar. + + + + + + + The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar. + + + + + + + .. + + + true + + + +