mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
Scale splash screen to size of screen
This commit is contained in:
parent
e5c887646a
commit
e3f9d1032d
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user