mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Progressbar should look nicer on the splash screen now.
This commit is contained in:
parent
6938777725
commit
18cc789f48
2 changed files with 4 additions and 6 deletions
Binary file not shown.
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 151 KiB |
|
@ -27,7 +27,7 @@ QSplashScreen()
|
|||
progress = 0;
|
||||
textX = 5;
|
||||
textY = 20;
|
||||
pbLeft = 0;
|
||||
pbLeft = 2;
|
||||
pbTop = 0;
|
||||
pbWidth = 100;
|
||||
pbHeight = 20;
|
||||
|
@ -42,14 +42,12 @@ void SplashScreen::setPixmap( const QPixmap &pixmap )
|
|||
QSplashScreen::setPixmap( pixmap );
|
||||
|
||||
if( this->pixmap().width() > 0 )
|
||||
pbWidth = this->pixmap().width();
|
||||
pbWidth = this->pixmap().width() - 4;
|
||||
|
||||
if( this->pixmap().height() > 0 )
|
||||
pbTop = this->pixmap().height();
|
||||
pbTop = this->pixmap().height() - pbHeight - 2;
|
||||
|
||||
textY = pbTop - pbHeight / 2;
|
||||
|
||||
resize( pbWidth, pbTop + pbHeight );
|
||||
}
|
||||
|
||||
void SplashScreen::setText( const QString &text )
|
||||
|
@ -92,7 +90,7 @@ void SplashScreen::drawContents( QPainter *painter )
|
|||
pbStyle.maximum = 100;
|
||||
pbStyle.progress = progress;
|
||||
pbStyle.invertedAppearance = false;
|
||||
pbStyle.rect = QRect( 0, pbTop, pbWidth, pbHeight );
|
||||
pbStyle.rect = QRect( pbLeft, pbTop, pbWidth, pbHeight );
|
||||
|
||||
style()->drawControl( QStyle::CE_ProgressBar, &pbStyle, painter, this );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue