From 67cd8e35ceaa1b00f834ef3f5c5ca2f615e4007c Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 5 Oct 2023 22:29:54 +0300 Subject: [PATCH] added cat pack support Signed-off-by: Trial97 --- launcher/ui/instanceview/InstancesView.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/launcher/ui/instanceview/InstancesView.cpp b/launcher/ui/instanceview/InstancesView.cpp index 232d15f3c..24ab2b959 100644 --- a/launcher/ui/instanceview/InstancesView.cpp +++ b/launcher/ui/instanceview/InstancesView.cpp @@ -30,6 +30,7 @@ #include "icons/IconImageProvider.h" #include "ui/instanceview/InstanceGridProxyModel.h" #include "ui/instanceview/InstanceTableProxyModel.h" +#include "ui/themes/ThemeManager.h" #include #include @@ -254,28 +255,16 @@ void InstancesView::setFilterQuery(const QString& query) void InstancesView::setCatDisplayed(bool enabled) { if (enabled) { - QDateTime now = QDateTime::currentDateTime(); - QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0)); - QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0)); - QDateTime birthday(QDate(now.date().year(), 10, 17), QTime(00, 0)); - QString cat = APPLICATION->settings()->get("BackgroundCat").toString(); - if (std::abs(now.daysTo(xmas)) <= 4) { - cat += "-xmas"; - } else if (std::abs(now.daysTo(halloween)) <= 12) { - cat += "-spooky"; - } else if (std::abs(now.daysTo(birthday)) <= 12) { - cat += "-bday"; - } setStyleSheet(QString(R"( * { - background-image: url(:/backgrounds/%1); + background-image: url(%1); background-attachment: fixed; background-clip: padding; background-position: bottom right; background-repeat: none; background-color: palette(base); })") - .arg(cat)); + .arg(APPLICATION->themeManager()->getCatPack())); m_table->setAlternatingRowColors(false); } else { setStyleSheet(QString());