summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 5daaeff..33717bc 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -98,27 +98,16 @@ public:
{
QIconViewItem *c = on ? currentItem() : 0;
+ qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" );
+
if ( bsy != c ) {
- if ( bsy )
- bsy-> repaint ( );
+ QIconViewItem *oldbsy = bsy;
bsy = c;
- if ( bsy ) {
- busystate = 5;
- for ( int i = 0; i <= 5; i++ )
- bpm [i] = QPixmap ( );
- timerEvent ( 0 );
- busytimer = startTimer ( 150 );
- }
- else
- killTimer ( busytimer );
- }
- }
+ if ( oldbsy )
+ oldbsy-> repaint ( );
- virtual void timerEvent ( QTimerEvent *te )
- {
- if ( !te || ( te-> timerId ( ) == busytimer )) {
if ( bsy ) {
- if ( bpm [::abs(busystate)]. isNull ( )) {
QPixmap *src = bsy-> QIconViewItem::pixmap();
+ for ( int i = 0; i <= 5; i++ ) {
QImage img = src->convertToImage();
QRgb* rgb;
@@ -132,5 +121,5 @@ public:
}
int rc, gc, bc;
- int bs = ::abs ( busystate * 10 ) + 25;
+ int bs = ::abs ( i * 10 ) + 25;
colorGroup().highlight().rgb( &rc, &gc, &bc );
rc = rc * bs / 100;
@@ -146,11 +135,28 @@ public:
}
- bpm [::abs(busystate)].convertFromImage( img );
+ bpm [i].convertFromImage( img );
+ }
+ busystate = 0;
+ if ( busytimer )
+ killTimer ( busytimer );
+ timerEvent ( 0 );
+ busytimer = startTimer ( 180 );
+ }
+ else {
+ killTimer ( busytimer );
+ busytimer = 0;
+ }
+ }
}
- bsy-> repaint ( );
+ virtual void timerEvent ( QTimerEvent *te )
+ {
+ if ( !te || ( te-> timerId ( ) == busytimer )) {
+ if ( bsy ) {
busystate++;
if ( busystate > 5 )
busystate = -4;
+
+ bsy-> repaint ( );
}
}
@@ -207,4 +213,5 @@ public:
{
if ( !bgPixmap.isNull() ) {
+ p-> fillRect ( r, bgColor );
p->drawTiledPixmap( r, bgPixmap,
QPoint( (r.x() + contentsX()) % bgPixmap.width(),