-rw-r--r-- | core/launcher/launcherview.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 33717bc..e15b150 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -137,13 +137,13 @@ public: bpm [i].convertFromImage( img ); } busystate = 0; if ( busytimer ) killTimer ( busytimer ); timerEvent ( 0 ); - busytimer = startTimer ( 180 ); + busytimer = startTimer ( 200 ); } else { killTimer ( busytimer ); busytimer = 0; } } @@ -154,13 +154,13 @@ public: if ( !te || ( te-> timerId ( ) == busytimer )) { if ( bsy ) { busystate++; if ( busystate > 5 ) busystate = -4; - bsy-> repaint ( ); + QScrollView::updateContents ( bsy-> pixmapRect ( false )); } } } bool inKeyEvent() const { return ike; } void keyPressEvent(QKeyEvent* e) @@ -199,23 +199,37 @@ public: k = maj.left(12) == "application/" ? maj : maj.left(sl); mimes.replace(k,(void*)1); } } void setBackgroundPixmap( const QPixmap &pm ) { + if ( pm. isNull ( )) { bgPixmap = pm; } + else { + // This is need for bg images with alpha channel + + QPixmap tmp ( pm. size ( ), pm. depth ( )); + + QPainter p ( &tmp ); + p. fillRect ( 0, 0, pm. width ( ), pm. height ( ), bgColor. isValid ( ) ? bgColor : white ); + p. drawPixmap ( 0, 0, pm ); + p. end ( ); + + bgPixmap = tmp; + } + } void setBackgroundColor( const QColor &c ) { bgColor = c; } void drawBackground( QPainter *p, const QRect &r ) { if ( !bgPixmap.isNull() ) { - p-> fillRect ( r, bgColor ); + //p-> fillRect ( r, bgColor ); p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), (r.y() + contentsY()) % bgPixmap.height() ) ); } else { p->fillRect( r, bgColor ); } |