Scale splash screen to size of screen

pull/1539/head
Jon Beniston 2022-12-20 09:56:30 +00:00
rodzic e5c887646a
commit e3f9d1032d
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -17,11 +17,20 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <QScreen>
#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()