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:
@@ -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>
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user