1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

Provide a splash screen without transparency if there's no compositing.

This commit is contained in:
Teo Mrnjavac
2014-01-17 18:50:14 +01:00
parent d8aa1d85d2
commit 9139708980
2 changed files with 23 additions and 2 deletions

View File

@@ -169,5 +169,6 @@
<file>data/www/css/style.css</file> <file>data/www/css/style.css</file>
<file>data/www/js/html5shim.js</file> <file>data/www/js/html5shim.js</file>
<file>data/images/splash.svg</file> <file>data/images/splash.svg</file>
<file>data/images/splash-unrounded.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -24,12 +24,32 @@
#include <QBoxLayout> #include <QBoxLayout>
#include <QLabel> #include <QLabel>
#ifdef Q_WS_X11
#include <QX11Info>
#endif
SplashWidget::SplashWidget() SplashWidget::SplashWidget()
: QSplashScreen() : QSplashScreen()
{ {
setPixmap( ImageRegistry::instance()->pixmap( RESPATH "images/splash.svg", //In 2014 there are still operating systems that cannot do transparency
TomahawkUtils::DpiScaler::scaled( this, QSize( 304, 333 ) ) ) ); bool compositingWorks = true;
#if defined(Q_WS_WIN)
compositingWorks = false;
#elif defined(Q_WS_X11)
if ( !QX11Info::isCompositingManagerRunning() )
compositingWorks = false;
#endif
QString imagePath;
if ( compositingWorks )
imagePath = RESPATH "images/splash.svg";
else
imagePath = RESPATH "images/splash-unrounded.svg";
QSize size( 304, 333 );
setPixmap( ImageRegistry::instance()->pixmap( imagePath,
TomahawkUtils::DpiScaler::scaled( this, size ), TomahawkUtils::Original ) );
QFont font = this->font(); QFont font = this->font();