diff --git a/ChangeLog b/ChangeLog index ab0374160..72cfd47eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-25 Tobias Doerffel + + * include/main_window.h: + * src/gui/main_window.cpp: + * src/core/main.cpp: + * data/themes/default/splash.png: + new transparent splash-screen without obsolete text-messages + 2008-05-25 Paul Giblock * include/embed.h: diff --git a/data/themes/default/splash.png b/data/themes/default/splash.png index 4c5bda864..d3034416b 100644 Binary files a/data/themes/default/splash.png and b/data/themes/default/splash.png differ diff --git a/include/main_window.h b/include/main_window.h index 1319e667b..bbae3c16f 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -34,7 +34,6 @@ class QAction; class QDomElement; class QGridLayout; class QMdiArea; -class QSplashScreen; class configManager; class pluginView; @@ -82,8 +81,6 @@ public: return( m_keyMods.m_alt ); } - static QSplashScreen * s_splashScreen; - static void saveWidgetState( QWidget * _w, QDomElement & _de ); static void restoreWidgetState( QWidget * _w, const QDomElement & _de ); diff --git a/src/core/main.cpp b/src/core/main.cpp index 32c4a3fb5..47f0621b4 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #ifdef HAVE_SCHED_H @@ -55,8 +57,6 @@ static inline QString baseName( const QString & _file ) } -int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft; - inline void loadTranslation( const QString & _tname, const QString & _dir = configManager::inst()->localeDir() ) { @@ -334,18 +334,29 @@ int main( int argc, char * * argv ) qApp->setPalette( pal ); - // init splash screen - QPixmap splash = embed::getIconPixmap( "splash" ); - mainWindow::s_splashScreen = new QSplashScreen( splash ); - mainWindow::s_splashScreen->show(); + // init splash screen - this is a bit difficult as we have a + // semi-transparent splash-image therefore we first need to grab + // the screen, paint the splash onto it and then set a mask + // which covers all pixels which are not fully transparent in + // splash-image - otherwise we get nasty edges etc. + const QPixmap splash = embed::getIconPixmap( "splash" ); + const QPoint pt = QApplication::desktop()-> + availableGeometry().center() - splash.rect().center(); + QPixmap pm = QPixmap::grabWindow( + QApplication::desktop()->winId(), + pt.x(), pt.y(), + splash.width(), splash.height() ); + QPainter p( &pm ); + p.drawPixmap( 0, 0, splash ); + p.end(); - mainWindow::s_splashScreen->showMessage( mainWindow::tr( - "Setting up main-" - "window and " - "workspace..." ), - splash_alignment_flags, - Qt::white ); + QSplashScreen * ss = new QSplashScreen( pm ); + ss->setWindowOpacity( 0.85 ); + ss->setMask( splash.alphaChannel().createMaskFromColor( QColor( 0, 0, 0 ) ) ); + ss->show(); + qApp->processEvents(); + // init central engine which handles all components of LMMS engine::init(); // we try to load given file @@ -372,9 +383,7 @@ int main( int argc, char * * argv ) engine::getMainWindow()->resize( 200, 500 ); } - - delete mainWindow::s_splashScreen; - mainWindow::s_splashScreen = NULL; + delete ss; } else { diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp index 3d8713a49..6cd217a50 100644 --- a/src/gui/main_window.cpp +++ b/src/gui/main_window.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include @@ -70,9 +69,6 @@ #include "templates.h" -QSplashScreen * mainWindow::s_splashScreen = NULL; -extern int splash_alignment_flags; - mainWindow::mainWindow( void ) : @@ -190,23 +186,6 @@ mainWindow::~mainWindow() void mainWindow::finalize( void ) { - if( qApp->argc() > 1 ) - { - s_splashScreen->showMessage( tr( "Loading song..." ), - splash_alignment_flags, - Qt::white ); - } - else - { - s_splashScreen->showMessage( tr( "Creating new song..." ), - splash_alignment_flags, - Qt::white ); - } - - - s_splashScreen->showMessage( tr( "Creating GUI..." ), - splash_alignment_flags, - Qt::white ); resetWindowTitle(); setWindowIcon( embed::getIconPixmap( "icon" ) );