NOISSUE kitty cat in a silly hat!

This commit is contained in:
Petr Mrázek 2018-12-24 03:26:14 +01:00
parent 56a9b65efb
commit 2e58429b6a
3 changed files with 8 additions and 3 deletions

View File

@ -1245,16 +1245,20 @@ void MainWindow::setCatBackground(bool enabled)
{
if (enabled)
{
view->setStyleSheet(R"(
QDateTime now = QDateTime::currentDateTime();
QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
;
QString cat = (abs(now.daysTo(xmas)) <= 4) ? "catmas" : "kitteh";
view->setStyleSheet(QString(R"(
GroupView
{
background-image: url(:/backgrounds/kitteh);
background-image: url(:/backgrounds/%1);
background-attachment: fixed;
background-clip: padding;
background-position: top right;
background-repeat: none;
background-color:palette(base);
})");
})").arg(cat));
}
else
{

View File

@ -2,5 +2,6 @@
<RCC version="1.0">
<qresource prefix="/backgrounds">
<file alias="kitteh">catbgrnd2.png</file>
<file alias="catmas">catmas.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB