-
Notifications
You must be signed in to change notification settings - Fork 1
/
Splash.cpp
24 lines (22 loc) · 850 Bytes
/
Splash.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "Splash.h"
#include "Globals.h"
#include <QLabel>
#include <QGridLayout>
#include <QString>
Splash::Splash(const QPixmap &pixmap, Qt::WindowFlags f) : QSplashScreen( pixmap, f )
{
QGridLayout *pLayout = new QGridLayout( this );
QLabel *pLabel1 = new QLabel( tr( "Loading..." ), this );
QLabel *pLabel2 = new QLabel( QString( "v%1" ).arg( VERSION ), this );
if( palette().background().color().redF() < 0.5 )
{
pLabel1->setStyleSheet("QLabel { color : black; }");
pLabel2->setStyleSheet("QLabel { color : black; }");
}
pLabel1->setAlignment( Qt::AlignLeft | Qt::AlignBottom );
pLabel2->setAlignment( Qt::AlignRight | Qt::AlignBottom );
pLayout->addWidget( pLabel1, 0, 0 );
pLayout->addWidget( pLabel2, 0, 1 );
pLayout->setContentsMargins( 5, 5, 5, 5 );
setLayout( pLayout );
}