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