Update launcher/Application.cpp with suggestion from scrumplex
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net> Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
parent
6daa457838
commit
7d440402ad
@ -498,7 +498,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
// Theming
|
// Theming
|
||||||
m_settings->registerSetting("IconTheme", QString("pe_colored"));
|
m_settings->registerSetting("IconTheme", QString("pe_colored"));
|
||||||
m_settings->registerSetting("ApplicationTheme");
|
m_settings->registerSetting("ApplicationTheme", QString());
|
||||||
m_settings->registerSetting("BackgroundCat", QString("kitteh"));
|
m_settings->registerSetting("BackgroundCat", QString("kitteh"));
|
||||||
|
|
||||||
// Remembered state
|
// Remembered state
|
||||||
|
@ -143,7 +143,7 @@ QString ThemeManager::getCatImage(QString catName)
|
|||||||
QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0));
|
QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0));
|
||||||
QDateTime xmas(QDate(now.date().year(), 12, 25), 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));
|
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) {
|
if (std::abs(now.daysTo(xmas)) <= 4) {
|
||||||
cat += "-xmas";
|
cat += "-xmas";
|
||||||
} else if (std::abs(now.daysTo(halloween)) <= 4) {
|
} else if (std::abs(now.daysTo(halloween)) <= 4) {
|
||||||
|
@ -40,6 +40,11 @@ class ThemeManager {
|
|||||||
void applyCurrentlySelectedTheme();
|
void applyCurrentlySelectedTheme();
|
||||||
void setApplicationTheme(const QString& name);
|
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 = "");
|
static QString getCatImage(QString catName = "");
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user