mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-15 13:32:35 +02:00
Provide a splash screen without transparency if there's no compositing.
This commit is contained in:
parent
d8aa1d85d2
commit
9139708980
@ -169,5 +169,6 @@
|
||||
<file>data/www/css/style.css</file>
|
||||
<file>data/www/js/html5shim.js</file>
|
||||
<file>data/images/splash.svg</file>
|
||||
<file>data/images/splash-unrounded.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -24,12 +24,32 @@
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QLabel>
|
||||
#ifdef Q_WS_X11
|
||||
#include <QX11Info>
|
||||
#endif
|
||||
|
||||
SplashWidget::SplashWidget()
|
||||
: QSplashScreen()
|
||||
{
|
||||
setPixmap( ImageRegistry::instance()->pixmap( RESPATH "images/splash.svg",
|
||||
TomahawkUtils::DpiScaler::scaled( this, QSize( 304, 333 ) ) ) );
|
||||
//In 2014 there are still operating systems that cannot do transparency
|
||||
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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user