Browse Source

update splash screen style #14

kvazar
kvazar 3 months ago
parent
commit
44b329967c
  1. 24
      src/qt/splashscreen.cpp

24
src/qt/splashscreen.cpp

@ -30,8 +30,8 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) @@ -30,8 +30,8 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
QWidget(0, f), curAlignment(0)
{
// set reference point, paddings
int paddingRight = 50;
int paddingTop = 50;
int paddingRight = 42;
int paddingTop = 64;
int titleVersionVSpace = 17;
int titleCopyrightVSpace = 40;
@ -59,14 +59,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) @@ -59,14 +59,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
#endif
QPainter pixPaint(&pixmap);
pixPaint.setPen(QColor(100,100,100));
// draw a slightly radial gradient
QRadialGradient gradient(QPoint(0,0), splashSize.width()/devicePixelRatio);
gradient.setColorAt(0, Qt::white);
gradient.setColorAt(1, QColor(247,247,247));
QRect rGradient(QPoint(0,0), splashSize);
pixPaint.fillRect(rGradient, gradient);
pixPaint.setPen(Qt::white);
// draw the bitcoin icon, expected size of PNG: 1024x1024
QRect rectIcon(QPoint(-150,-122), QSize(430,430));
@ -76,6 +69,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) @@ -76,6 +69,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
pixPaint.drawPixmap(rectIcon, icon);
// draw a slightly radial gradient
QRadialGradient gradient(QPoint(0,0), splashSize.width()/devicePixelRatio);
gradient.setColorAt(0, QColor(255,255,255,100));
gradient.setColorAt(1, QColor(0,0,0,30));
QRect rGradient(QPoint(0,0), splashSize);
pixPaint.fillRect(rGradient, gradient);
// check font size and drawing with
pixPaint.setFont(QFont(font, 33*fontFactor));
QFontMetrics fm = pixPaint.fontMetrics();
@ -84,7 +84,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) @@ -84,7 +84,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
fontFactor = fontFactor * 176 / titleTextWidth;
}
pixPaint.setFont(QFont(font, 33*fontFactor));
pixPaint.setFont(QFont(font, 48*fontFactor));
fm = pixPaint.fontMetrics();
titleTextWidth = fm.width(titleText);
pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop,titleText);
@ -167,7 +167,7 @@ static void InitMessage(SplashScreen *splash, const std::string &message) @@ -167,7 +167,7 @@ static void InitMessage(SplashScreen *splash, const std::string &message)
Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(message)),
Q_ARG(int, Qt::AlignBottom|Qt::AlignHCenter),
Q_ARG(QColor, QColor(55,55,55)));
Q_ARG(QColor, Qt::gray));
}
static void ShowProgress(SplashScreen *splash, const std::string &title, int nProgress, bool resume_possible)

Loading…
Cancel
Save