diff options
author | Tayou <31988415+TayouVR@users.noreply.github.com> | 2023-01-04 14:30:25 +0100 |
---|---|---|
committer | Tayou <tayou@gmx.net> | 2023-01-10 16:06:42 +0100 |
commit | 7d440402ade59fd38b6f1d6b70fb51449cc57e5d (patch) | |
tree | 1874cb799fdcb4e40e7479c458686d4be9f31605 /launcher/ui/themes | |
parent | 6daa45783894fc7517917d6f6df0deaac1a41ba3 (diff) | |
download | PrismLauncher-7d440402ade59fd38b6f1d6b70fb51449cc57e5d.tar.gz PrismLauncher-7d440402ade59fd38b6f1d6b70fb51449cc57e5d.tar.bz2 PrismLauncher-7d440402ade59fd38b6f1d6b70fb51449cc57e5d.zip |
Update launcher/Application.cpp with suggestion from scrumplex
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Tayou <tayou@gmx.net>
Diffstat (limited to 'launcher/ui/themes')
-rw-r--r-- | launcher/ui/themes/ThemeManager.cpp | 4 | ||||
-rw-r--r-- | launcher/ui/themes/ThemeManager.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp index 44c13f40..7ccc946a 100644 --- a/launcher/ui/themes/ThemeManager.cpp +++ b/launcher/ui/themes/ThemeManager.cpp @@ -143,7 +143,7 @@ QString ThemeManager::getCatImage(QString catName) QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0));
QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0));
- QString cat = catName == "" ? APPLICATION->settings()->get("BackgroundCat").toString() : catName;
+ QString cat = !catName.isEmpty() ? catName : APPLICATION->settings()->get("BackgroundCat").toString();
if (std::abs(now.daysTo(xmas)) <= 4) {
cat += "-xmas";
} else if (std::abs(now.daysTo(halloween)) <= 4) {
@@ -152,4 +152,4 @@ QString ThemeManager::getCatImage(QString catName) cat += "-bday";
}
return cat;
-}
\ No newline at end of file +}
diff --git a/launcher/ui/themes/ThemeManager.h b/launcher/ui/themes/ThemeManager.h index 4f36bffa..d5e73bb8 100644 --- a/launcher/ui/themes/ThemeManager.h +++ b/launcher/ui/themes/ThemeManager.h @@ -40,6 +40,11 @@ class ThemeManager { void applyCurrentlySelectedTheme();
void setApplicationTheme(const QString& name);
+ /// <summary>
+ /// Returns the cat based on selected cat and with events (Birthday, XMas, etc.)
+ /// </summary>
+ /// <param name="catName">Optional, if you need a specific cat.</param>
+ /// <returns></returns>
static QString getCatImage(QString catName = "");
private:
|