-rw-r--r-- | core/launcher/launcherview.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 33717bc..e15b150 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -131,42 +131,42 @@ public: | |||
131 | int gi = gc + qGreen ( *rgb ) * ( 100 - bs ) / 100; | 131 | int gi = gc + qGreen ( *rgb ) * ( 100 - bs ) / 100; |
132 | int bi = bc + qBlue ( *rgb ) * ( 100 - bs ) / 100; | 132 | int bi = bc + qBlue ( *rgb ) * ( 100 - bs ) / 100; |
133 | int ai = qAlpha ( *rgb ); | 133 | int ai = qAlpha ( *rgb ); |
134 | *rgb = qRgba ( ri, gi, bi, ai ); | 134 | *rgb = qRgba ( ri, gi, bi, ai ); |
135 | } | 135 | } |
136 | 136 | ||
137 | bpm [i].convertFromImage( img ); | 137 | bpm [i].convertFromImage( img ); |
138 | } | 138 | } |
139 | busystate = 0; | 139 | busystate = 0; |
140 | if ( busytimer ) | 140 | if ( busytimer ) |
141 | killTimer ( busytimer ); | 141 | killTimer ( busytimer ); |
142 | timerEvent ( 0 ); | 142 | timerEvent ( 0 ); |
143 | busytimer = startTimer ( 180 ); | 143 | busytimer = startTimer ( 200 ); |
144 | } | 144 | } |
145 | else { | 145 | else { |
146 | killTimer ( busytimer ); | 146 | killTimer ( busytimer ); |
147 | busytimer = 0; | 147 | busytimer = 0; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | virtual void timerEvent ( QTimerEvent *te ) | 152 | virtual void timerEvent ( QTimerEvent *te ) |
153 | { | 153 | { |
154 | if ( !te || ( te-> timerId ( ) == busytimer )) { | 154 | if ( !te || ( te-> timerId ( ) == busytimer )) { |
155 | if ( bsy ) { | 155 | if ( bsy ) { |
156 | busystate++; | 156 | busystate++; |
157 | if ( busystate > 5 ) | 157 | if ( busystate > 5 ) |
158 | busystate = -4; | 158 | busystate = -4; |
159 | 159 | ||
160 | bsy-> repaint ( ); | 160 | QScrollView::updateContents ( bsy-> pixmapRect ( false )); |
161 | } | 161 | } |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | bool inKeyEvent() const { return ike; } | 165 | bool inKeyEvent() const { return ike; } |
166 | void keyPressEvent(QKeyEvent* e) | 166 | void keyPressEvent(QKeyEvent* e) |
167 | { | 167 | { |
168 | ike = TRUE; | 168 | ike = TRUE; |
169 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) | 169 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) |
170 | returnPressed(currentItem()); | 170 | returnPressed(currentItem()); |
171 | QIconView::keyPressEvent(e); | 171 | QIconView::keyPressEvent(e); |
172 | ike = FALSE; | 172 | ike = FALSE; |
@@ -193,35 +193,49 @@ public: | |||
193 | // cats.replace(*cit,(void*)1); | 193 | // cats.replace(*cit,(void*)1); |
194 | // } | 194 | // } |
195 | QString maj=app->type(); | 195 | QString maj=app->type(); |
196 | int sl=maj.find('/'); | 196 | int sl=maj.find('/'); |
197 | if (sl>=0) { | 197 | if (sl>=0) { |
198 | QString k; | 198 | QString k; |
199 | k = maj.left(12) == "application/" ? maj : maj.left(sl); | 199 | k = maj.left(12) == "application/" ? maj : maj.left(sl); |
200 | mimes.replace(k,(void*)1); | 200 | mimes.replace(k,(void*)1); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | void setBackgroundPixmap( const QPixmap &pm ) { | 204 | void setBackgroundPixmap( const QPixmap &pm ) { |
205 | bgPixmap = pm; | 205 | if ( pm. isNull ( )) { |
206 | bgPixmap = pm; | ||
207 | } | ||
208 | else { | ||
209 | // This is need for bg images with alpha channel | ||
210 | |||
211 | QPixmap tmp ( pm. size ( ), pm. depth ( )); | ||
212 | |||
213 | QPainter p ( &tmp ); | ||
214 | p. fillRect ( 0, 0, pm. width ( ), pm. height ( ), bgColor. isValid ( ) ? bgColor : white ); | ||
215 | p. drawPixmap ( 0, 0, pm ); | ||
216 | p. end ( ); | ||
217 | |||
218 | bgPixmap = tmp; | ||
219 | } | ||
206 | } | 220 | } |
207 | 221 | ||
208 | void setBackgroundColor( const QColor &c ) { | 222 | void setBackgroundColor( const QColor &c ) { |
209 | bgColor = c; | 223 | bgColor = c; |
210 | } | 224 | } |
211 | 225 | ||
212 | void drawBackground( QPainter *p, const QRect &r ) | 226 | void drawBackground( QPainter *p, const QRect &r ) |
213 | { | 227 | { |
214 | if ( !bgPixmap.isNull() ) { | 228 | if ( !bgPixmap.isNull() ) { |
215 | p-> fillRect ( r, bgColor ); | 229 | //p-> fillRect ( r, bgColor ); |
216 | p->drawTiledPixmap( r, bgPixmap, | 230 | p->drawTiledPixmap( r, bgPixmap, |
217 | QPoint( (r.x() + contentsX()) % bgPixmap.width(), | 231 | QPoint( (r.x() + contentsX()) % bgPixmap.width(), |
218 | (r.y() + contentsY()) % bgPixmap.height() ) ); | 232 | (r.y() + contentsY()) % bgPixmap.height() ) ); |
219 | } else { | 233 | } else { |
220 | p->fillRect( r, bgColor ); | 234 | p->fillRect( r, bgColor ); |
221 | } | 235 | } |
222 | } | 236 | } |
223 | 237 | ||
224 | void setItemTextPos( ItemTextPos pos ) | 238 | void setItemTextPos( ItemTextPos pos ) |
225 | { | 239 | { |
226 | calculateGrid( pos ); | 240 | calculateGrid( pos ); |
227 | QIconView::setItemTextPos( pos ); | 241 | QIconView::setItemTextPos( pos ); |