summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp57
1 files changed, 50 insertions, 7 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 6e63fca..9fc4565 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -109,12 +109,17 @@ public:
QIconViewItem *oldbsy = bsy;
bsy = c;
if ( oldbsy )
oldbsy-> repaint ( );
+ if ( busytimer ) {
+ killTimer ( busytimer );
+ busytimer = 0;
+ }
+
if ( bsy ) {
QPixmap *src = bsy-> QIconViewItem::pixmap();
for ( int i = 0; i <= 5; i++ ) {
QImage img = src->convertToImage();
QRgb* rgb;
int count;
@@ -139,26 +144,22 @@ public:
int ai = qAlpha ( *rgb );
*rgb = qRgba ( ri, gi, bi, ai );
}
bpm [i].convertFromImage( img );
}
+
if ( busyType == BIT_Blinking ) {
busystate = 0;
- if ( busytimer )
- killTimer ( busytimer );
busytimer = startTimer ( 200 );
}
- else
+ else {
busystate = 3;
+ }
timerEvent ( 0 );
}
- else {
- killTimer ( busytimer );
- busytimer = 0;
- }
}
}
virtual void timerEvent ( QTimerEvent *te )
{
if ( !te || ( te-> timerId ( ) == busytimer )) {
@@ -329,12 +330,53 @@ protected:
setSpacing( 2 );
setGridX( (viewerWidth-(cols+1)*spacing())/cols );
setGridY( fontMetrics().height()+2 );
}
}
+
+ // flicker free redrawing of busy indicator
+ // code was taken from QScrollView::viewportPaintEvent
+ void viewportPaintEvent( QPaintEvent* pe )
+ {
+ static QPixmap *pix = new QPixmap ( );
+
+ QWidget* vp = viewport();
+
+ if ( vp-> size ( ) != pix-> size ( ))
+ pix-> resize ( vp-> size ( ));
+
+ QPainter p(pix, vp);
+ QRect r = pe->rect();
+ if ( clipper ( ) != vp ) {
+ QRect rr(
+ -vp->x(), -vp->y(),
+ clipper()->width(), clipper()->height()
+ );
+ r &= rr;
+ if ( r.isValid() ) {
+ int ex = r.x() + vp->x() + contentsX();
+ int ey = r.y() + vp->y() + contentsY();
+ int ew = r.width();
+ int eh = r.height();
+ drawContentsOffset(&p,
+ contentsX()+vp->x(),
+ contentsY()+vp->y(),
+ ex, ey, ew, eh);
+ }
+ } else {
+ r &= clipper()->rect();
+ int ex = r.x() + contentsX();
+ int ey = r.y() + contentsY();
+ int ew = r.width();
+ int eh = r.height();
+ drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh);
+ }
+ bitBlt ( vp, r.topLeft(), pix, r );
+ }
+
private:
QList<AppLnk> hidden;
QDict<void> mimes;
QDict<void> cats;
SortMethod sortmeth;
QRegExp tf;
@@ -928,6 +970,7 @@ void LauncherView::setBusyIndicatorType ( const QString &type )
{
if ( type. lower ( ) == "blink" )
icons-> setBusyIndicatorType ( BIT_Blinking );
else
icons-> setBusyIndicatorType ( BIT_Normal );
}
+