Browse Source

splashscreen: Resize text to fit exactly

pull/1/head
Luke Dashjr 7 years ago
parent
commit
78ec83ddfe
  1. 7
      src/qt/splashscreen.cpp

7
src/qt/splashscreen.cpp

@ -79,10 +79,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) @@ -79,10 +79,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
// check font size and drawing with
pixPaint.setFont(QFont(font, 33*fontFactor));
QFontMetrics fm = pixPaint.fontMetrics();
int titleTextWidth = fm.width(titleText);
if(titleTextWidth > 160) {
// strange font rendering, Arial probably not found
fontFactor = 0.75;
int titleTextWidth = fm.width(titleText);
if (titleTextWidth > 176) {
fontFactor = fontFactor * 176 / titleTextWidth;
}
pixPaint.setFont(QFont(font, 33*fontFactor));

Loading…
Cancel
Save