-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: | |||
99 | QIconViewItem *c = on ? currentItem() : 0; | 99 | QIconViewItem *c = on ? currentItem() : 0; |
100 | qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" ); | ||
101 | |||
100 | if ( bsy != c ) { | 102 | if ( bsy != c ) { |
101 | if ( bsy ) | 103 | QIconViewItem *oldbsy = bsy; |
102 | bsy-> repaint ( ); | ||
103 | bsy = c; | 104 | bsy = c; |
104 | 105 | ||
106 | if ( oldbsy ) | ||
107 | oldbsy-> repaint ( ); | ||
108 | |||
105 | if ( bsy ) { | 109 | if ( bsy ) { |
106 | busystate = 5; | 110 | QPixmap *src = bsy-> QIconViewItem::pixmap(); |
107 | for ( int i = 0; i <= 5; i++ ) | 111 | for ( int i = 0; i <= 5; i++ ) { |
108 | bpm [i] = QPixmap ( ); | ||
109 | timerEvent ( 0 ); | ||
110 | busytimer = startTimer ( 150 ); | ||
111 | } | ||
112 | else | ||
113 | killTimer ( busytimer ); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | virtual void timerEvent ( QTimerEvent *te ) | ||
118 | { | ||
119 | if ( !te || ( te-> timerId ( ) == busytimer )) { | ||
120 | if ( bsy ) { | ||
121 | if ( bpm [::abs(busystate)]. isNull ( )) { | ||
122 | QPixmap *src = bsy-> QIconViewItem::pixmap(); | ||
123 | QImage img = src->convertToImage(); | 112 | QImage img = src->convertToImage(); |
@@ -133,3 +122,3 @@ public: | |||
133 | int rc, gc, bc; | 122 | int rc, gc, bc; |
134 | int bs = ::abs ( busystate * 10 ) + 25; | 123 | int bs = ::abs ( i * 10 ) + 25; |
135 | colorGroup().highlight().rgb( &rc, &gc, &bc ); | 124 | colorGroup().highlight().rgb( &rc, &gc, &bc ); |
@@ -147,6 +136,21 @@ public: | |||
147 | 136 | ||
148 | bpm [::abs(busystate)].convertFromImage( img ); | 137 | bpm [i].convertFromImage( img ); |
149 | } | 138 | } |
150 | bsy-> repaint ( ); | 139 | busystate = 0; |
140 | if ( busytimer ) | ||
141 | killTimer ( busytimer ); | ||
142 | timerEvent ( 0 ); | ||
143 | busytimer = startTimer ( 180 ); | ||
144 | } | ||
145 | else { | ||
146 | killTimer ( busytimer ); | ||
147 | busytimer = 0; | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | 151 | ||
152 | virtual void timerEvent ( QTimerEvent *te ) | ||
153 | { | ||
154 | if ( !te || ( te-> timerId ( ) == busytimer )) { | ||
155 | if ( bsy ) { | ||
152 | busystate++; | 156 | busystate++; |
@@ -154,2 +158,4 @@ public: | |||
154 | busystate = -4; | 158 | busystate = -4; |
159 | |||
160 | bsy-> repaint ( ); | ||
155 | } | 161 | } |
@@ -208,3 +214,4 @@ public: | |||
208 | if ( !bgPixmap.isNull() ) { | 214 | if ( !bgPixmap.isNull() ) { |
209 | p->drawTiledPixmap( r, bgPixmap, | 215 | p-> fillRect ( r, bgColor ); |
216 | p->drawTiledPixmap( r, bgPixmap, | ||
210 | QPoint( (r.x() + contentsX()) % bgPixmap.width(), | 217 | QPoint( (r.x() + contentsX()) % bgPixmap.width(), |