diff --git a/src/Gui/Icons/freecadsplash2x.png b/src/Gui/Icons/freecadsplash2x.png new file mode 100644 index 0000000000..d924a7bee3 Binary files /dev/null and b/src/Gui/Icons/freecadsplash2x.png differ diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 5763709347..37e4cb8e24 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -1,6 +1,7 @@ freecadsplash.png + freecadsplash2x.png freecadabout.png background.png mouse_pointer.svg diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 91bfc02dde..3b3f62af7e 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1525,7 +1525,15 @@ QPixmap MainWindow::splashImage() const // now try the icon paths if (splash_image.isNull()) { - splash_image = Gui::BitmapFactory().pixmap(splash_path.c_str()); + if (qApp->devicePixelRatio() > 1.0) { + // For HiDPI screens, we have a double-resolution version of the splash image + splash_path += "2x"; + splash_image = Gui::BitmapFactory().pixmap(splash_path.c_str()); + splash_image.setDevicePixelRatio(2.0); + } + else { + splash_image = Gui::BitmapFactory().pixmap(splash_path.c_str()); + } } // include application name and version number @@ -1559,14 +1567,14 @@ QPixmap MainWindow::splashImage() const } QFont fontExe = painter.font(); - fontExe.setPointSize(20); + fontExe.setPointSizeF(20.0); QFontMetrics metricExe(fontExe); int l = QtTools::horizontalAdvance(metricExe, title); int w = splash_image.width(); int h = splash_image.height(); QFont fontVer = painter.font(); - fontVer.setPointSize(12); + fontVer.setPointSizeF(12.0); QFontMetrics metricVer(fontVer); int v = QtTools::horizontalAdvance(metricVer, version);