new transparent splash-screen without obsolete text-messages
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1018 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2008-05-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* 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 <drfaygo/at/gmail/dot/com>
|
||||
|
||||
* include/embed.h:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 62 KiB |
@@ -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 );
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QTranslator>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QSplashScreen>
|
||||
|
||||
#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
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <QtGui/QMdiSubWindow>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QSplashScreen>
|
||||
#include <QtGui/QSplitter>
|
||||
|
||||
|
||||
@@ -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" ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user