summaryrefslogtreecommitdiff
authorsandman <sandman>2002-09-29 02:08:31 (UTC)
committer sandman <sandman>2002-09-29 02:08:31 (UTC)
commitb7fcdc189dacc8e054a32090af4677bc86955491 (patch) (unidiff)
tree43b500b48fb7718a8c84b7aab91398c568b64b5d
parentd6ac648c6f0f504f2f9c3b21d62524d3167682ae (diff)
downloadopie-b7fcdc189dacc8e054a32090af4677bc86955491.zip
opie-b7fcdc189dacc8e054a32090af4677bc86955491.tar.gz
opie-b7fcdc189dacc8e054a32090af4677bc86955491.tar.bz2
compromise for the new busy indicator:
old explosion + new highlight = exploding highlight ;)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp50
1 files changed, 38 insertions, 12 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index c2bde53..9f86136 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -67,6 +67,7 @@ public:
67 sortmeth = Name; 67 sortmeth = Name;
68 hidden.setAutoDelete(TRUE); 68 hidden.setAutoDelete(TRUE);
69 ike = FALSE; 69 ike = FALSE;
70 busytimer = 0;
70 calculateGrid( Bottom ); 71 calculateGrid( Bottom );
71 } 72 }
72 73
@@ -97,8 +98,25 @@ public:
97 { 98 {
98 QIconViewItem *c = on ? currentItem() : 0; 99 QIconViewItem *c = on ? currentItem() : 0;
99 if ( bsy != c ) { 100 if ( bsy != c ) {
100 if ( c ) { 101 if ( bsy )
101 QPixmap *src = c->pixmap(); 102 bsy-> repaint ( );
103 bsy = c;
104
105 if ( bsy ) {
106 busytimer = startTimer ( 150 );
107 busystate = 50;
108 startTimer ( 0 );
109 }
110 else
111 killTimer ( busytimer );
112 }
113 }
114
115 virtual void timerEvent ( QTimerEvent *te )
116 {
117 if ( !te || ( te-> timerId ( ) == busytimer )) {
118 if ( bsy ) {
119 QPixmap *src = bsy-> QIconViewItem::pixmap();
102 QImage img = src->convertToImage(); 120 QImage img = src->convertToImage();
103 QRgb* rgb; 121 QRgb* rgb;
104 int count; 122 int count;
@@ -110,22 +128,28 @@ public:
110 count = img.numColors(); 128 count = img.numColors();
111 } 129 }
112 int rc, gc, bc; 130 int rc, gc, bc;
131 int bs = ::abs ( busystate ) + 25;
113 colorGroup().highlight().rgb( &rc, &gc, &bc ); 132 colorGroup().highlight().rgb( &rc, &gc, &bc );
114 int ri, gi, bi; 133 rc = rc * bs / 100;
134 gc = gc * bs / 100;
135 bc = bc * bs / 100;
136
115 for ( int r = 0; r < count; r++, rgb++ ) { 137 for ( int r = 0; r < count; r++, rgb++ ) {
116 int ri = (rc+qRed(*rgb))/2; 138 int ri = rc + qRed ( *rgb ) * ( 100 - bs ) / 100;
117 int gi = (gc+qGreen(*rgb))/2; 139 int gi = gc + qGreen ( *rgb ) * ( 100 - bs ) / 100;
118 int bi = (bc+qBlue(*rgb))/2; 140 int bi = bc + qBlue ( *rgb ) * ( 100 - bs ) / 100;
119 int ai = qAlpha(*rgb); 141 int ai = qAlpha ( *rgb );
120 *rgb = qRgba(ri,gi,bi,ai); 142 *rgb = qRgba ( ri, gi, bi, ai );
121 } 143 }
122 144
123 bpm.convertFromImage( img ); 145 bpm.convertFromImage( img );
146
147 bsy-> repaint ( );
148
149 busystate += 10;
150 if ( busystate > 50 )
151 busystate = -40;
124 } 152 }
125 QIconViewItem* o = bsy;
126 bsy = c;
127 if ( o ) o->repaint();
128 if ( c ) c->repaint();
129 } 153 }
130 } 154 }
131 155
@@ -287,6 +311,8 @@ private:
287 QPixmap bgPixmap; 311 QPixmap bgPixmap;
288 QPixmap bpm; 312 QPixmap bpm;
289 QColor bgColor; 313 QColor bgColor;
314 int busytimer;
315 int busystate;
290}; 316};
291 317
292 318