93{
94 constexpr int SPLASH_HEIGHT_LOADING = 480;
95 constexpr int SPLASH_HEIGHT_ABOUT = 320;
96
97 int splashHeight;
99 splashHeight = SPLASH_HEIGHT_ABOUT;
100 } else {
101 splashHeight = SPLASH_HEIGHT_LOADING;
102 }
103 const int bannerHeight = splashHeight * 0.16875;
104 const int marginTop = splashHeight * 0.05;
105 const int marginRight = splashHeight * 0.1;
106
107 QString splashName = QStringLiteral(":/splash/0.png");
108 QString splashArtist = QStringLiteral("Tyson Tan");
109
110#if 0
111 QDate currentDate = QDate::currentDate();
112 if (currentDate > QDate(currentDate.year(), 12, 4) ||
113 currentDate < QDate(currentDate.year(), 1, 9)) {
114 splashName = QStringLiteral(":/splash/1.png");
115 splashArtist = QStringLiteral("???");
116 }
117#endif
118
119 QPixmap img(splashName);
120
121 if (img.isNull() || img.height() == 0) return;
122
123
124 const int height = splashHeight;
125 const int width = height * img.width() / img.height();
126
127 setFixedWidth(width);
128 setFixedHeight(height);
129 lblSplash->setFixedWidth(width);
130 lblSplash->setFixedHeight(height);
131
132
133 const int pixelWidth = width * devicePixelRatioF();
134 const int pixelHeight = height * devicePixelRatioF();
135 img = img.scaled(pixelWidth, pixelHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
136 img.setDevicePixelRatio(devicePixelRatioF());
137 lblSplash->setPixmap(img);
138
139
143
144
147
148
151
152
153 if (splashArtist.isEmpty()) {
155 } else {
156 m_artCreditsLabel->setText(i18nc(
"splash image credit",
"Artwork by: %1", splashArtist));
157 }
161
163 setFixedSize(sizeHint());
164 }
165}