summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-23 23:51:11 (UTC)
committer sandman <sandman>2002-10-23 23:51:11 (UTC)
commit36e13db0a1d44abd5a160a34e4679b90d62826c7 (patch) (side-by-side diff)
tree6996137d6ffd992e7eef8be1802d667b3184f62a
parent8d8ebc66cefd889c0cbc13d7d3d4158bdcb55962 (diff)
downloadopie-36e13db0a1d44abd5a160a34e4679b90d62826c7.zip
opie-36e13db0a1d44abd5a160a34e4679b90d62826c7.tar.gz
opie-36e13db0a1d44abd5a160a34e4679b90d62826c7.tar.bz2
- fix for the busy indicator timer, in case someone switches to non-blink
style, while the indicator is blinking - the launcher QIconView is now drawn flickerfree into a background QPixmap
Diffstat (more/less context) (show 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
@@ -111,8 +111,13 @@ public:
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();
@@ -141,21 +146,17 @@ public:
}
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;
+ timerEvent ( 0 );
}
}
}
@@ -331,8 +332,49 @@ protected:
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;
@@ -930,4 +972,5 @@ void LauncherView::setBusyIndicatorType ( const QString &type )
icons-> setBusyIndicatorType ( BIT_Blinking );
else
icons-> setBusyIndicatorType ( BIT_Normal );
}
+