author | sandman <sandman> | 2002-09-30 23:06:39 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-30 23:06:39 (UTC) |
commit | 37a8266f4a32d07a27d453897febf1f25963a4d0 (patch) (side-by-side diff) | |
tree | 38f41045da51b99b76a69b42beaafd0124564cc9 /core/launcher | |
parent | 6fdaab436d4fa72b3de06a1a9cf9be0bd964677a (diff) | |
download | opie-37a8266f4a32d07a27d453897febf1f25963a4d0.zip opie-37a8266f4a32d07a27d453897febf1f25963a4d0.tar.gz opie-37a8266f4a32d07a27d453897febf1f25963a4d0.tar.bz2 |
- again some speedups for the new busy indicator
- (inefficient) fix for background pixmaps with alpha channel (untested)
-rw-r--r-- | core/launcher/launcherview.cpp | 53 |
1 files changed, 30 insertions, 23 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 @@ -99,25 +99,14 @@ 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 ( oldbsy ) + oldbsy-> repaint ( ); + if ( bsy ) { - busystate = 5; - for ( int i = 0; i <= 5; i++ ) - bpm [i] = QPixmap ( ); - timerEvent ( 0 ); - busytimer = startTimer ( 150 ); - } - else - killTimer ( busytimer ); - } - } - - virtual void timerEvent ( QTimerEvent *te ) - { - if ( !te || ( te-> timerId ( ) == busytimer )) { - if ( bsy ) { - if ( bpm [::abs(busystate)]. isNull ( )) { - QPixmap *src = bsy-> QIconViewItem::pixmap(); + QPixmap *src = bsy-> QIconViewItem::pixmap(); + for ( int i = 0; i <= 5; i++ ) { QImage img = src->convertToImage(); @@ -133,3 +122,3 @@ public: int rc, gc, bc; - int bs = ::abs ( busystate * 10 ) + 25; + int bs = ::abs ( i * 10 ) + 25; colorGroup().highlight().rgb( &rc, &gc, &bc ); @@ -147,6 +136,21 @@ public: - bpm [::abs(busystate)].convertFromImage( img ); + bpm [i].convertFromImage( img ); } - bsy-> repaint ( ); + busystate = 0; + if ( busytimer ) + killTimer ( busytimer ); + timerEvent ( 0 ); + busytimer = startTimer ( 180 ); + } + else { + killTimer ( busytimer ); + busytimer = 0; + } + } + } + virtual void timerEvent ( QTimerEvent *te ) + { + if ( !te || ( te-> timerId ( ) == busytimer )) { + if ( bsy ) { busystate++; @@ -154,2 +158,4 @@ public: busystate = -4; + + bsy-> repaint ( ); } @@ -208,3 +214,4 @@ public: if ( !bgPixmap.isNull() ) { - p->drawTiledPixmap( r, bgPixmap, + p-> fillRect ( r, bgColor ); + p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), |