Skip to content

Commit

Permalink
[gui/hidpi] scale splash screen on startup not on release
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 2, 2016
1 parent 87d0168 commit 9446b20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
8 changes: 1 addition & 7 deletions scripts/release.pl
Expand Up @@ -131,8 +131,6 @@ ($$)
my $splashwidth;
unless( $dopoint ) {
pod2usage("Splash images/splash/splash-$newmajor.$newminor.png not found") unless -r "images/splash/splash-$newmajor.$newminor.png";
$splashwidth = `identify -format '%w' images/splash/splash-$newmajor.$newminor.png`;
print "WARNING: Splash images/splash/splash-$newmajor.$newminor.png is $splashwidth pixels wide - will be rescaled\n" if $splashwidth != 600;
pod2usage("NSIS image ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.bmp not found") unless -r "ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.bmp";
my $welcomeformat = `identify -format '%wx%h %m' ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.bmp`;
pod2usage("NSIS Image ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.bmp mis-sized [$welcomeformat vs. 164x314 BMP3]") unless $welcomeformat =~ /^164x314 /;
Expand Down Expand Up @@ -174,11 +172,7 @@ ($$)
run( "cp debian/changelog /tmp", "backup changelog failed" );

unless( $dopoint ) {
if( $splashwidth != 600 ) {
run( "convert -resize 600x300 images/splash/splash-$newmajor.$newminor.png images/splash/splash.png", "rescale of splash png failed" );
} else {
run( "cp -v images/splash/splash-$newmajor.$newminor.png images/splash/splash.png", "splash png switch failed" );
}
run( "cp -v images/splash/splash-$newmajor.$newminor.png images/splash/splash.png", "splash png switch failed" );
run( "convert -resize 164x314 ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.bmp BMP3:ms-windows/Installer-Files/WelcomeFinishPage.bmp", "installer bitmap switch failed" );

if( -f "images/splash/splash-release.xcf.bz2" ) {
Expand Down
13 changes: 7 additions & 6 deletions src/app/main.cpp
Expand Up @@ -37,6 +37,7 @@
#if QT_VERSION < 0x050000
#include <QPlastiqueStyle>
#endif
#include <QDesktopWidget>
#include <QTranslator>
#include <QImageReader>
#include <QMessageBox>
Expand Down Expand Up @@ -1032,12 +1033,12 @@ int main( int argc, char *argv[] )
//set up splash screen
QString mySplashPath( QgsCustomization::instance()->splashPath() );
QPixmap myPixmap( mySplashPath + QLatin1String( "splash.png" ) );
QSplashScreen *mypSplash = new QSplashScreen( myPixmap );
if ( mySettings.value( "/qgis/hideSplash" ).toBool() || myHideSplash )
{
//splash screen hidden
}
else

double w = 600 * qApp->desktop()->logicalDpiX() / 96;
double h = 300 * qApp->desktop()->logicalDpiY() / 96;

QSplashScreen *mypSplash = new QSplashScreen( myPixmap.scaled( w, h, Qt::KeepAspectRatio ) );
if ( !myHideSplash && !mySettings.value( "/qgis/hideSplash" ).toBool() )
{
//for win and linux we can just automask and png transparency areas will be used
mypSplash->setMask( myPixmap.mask() );
Expand Down

0 comments on commit 9446b20

Please sign in to comment.