From e3f9d1032dde761f5880ffc4f8f877f90089cc5a Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Tue, 20 Dec 2022 09:56:30 +0000 Subject: [PATCH] Scale splash screen to size of screen --- sdrgui/gui/sdrangelsplash.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sdrgui/gui/sdrangelsplash.cpp b/sdrgui/gui/sdrangelsplash.cpp index f0fc4f5c4..e56b2d1a3 100644 --- a/sdrgui/gui/sdrangelsplash.cpp +++ b/sdrgui/gui/sdrangelsplash.cpp @@ -17,11 +17,20 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include + #include "sdrangelsplash.h" SDRangelSplash::SDRangelSplash(const QPixmap& pixmap) { - QSplashScreen::setPixmap(pixmap); + int screenWidth = screen()->availableGeometry().width(); + QPixmap pm; + if (pixmap.width() > screenWidth) { + pm = pixmap.scaledToWidth(screenWidth, Qt::SmoothTransformation); + } else { + pm = pixmap; + } + QSplashScreen::setPixmap(pm); }; SDRangelSplash::~SDRangelSplash()