Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/launcherview.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index e7229ee..a4c7561 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -285,45 +285,55 @@ QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0; | |||
285 | LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) | 285 | LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) |
286 | : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white),numColumns(0) | 286 | : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white),numColumns(0) |
287 | { | 287 | { |
288 | m_EyeCallBack = 0; | 288 | m_EyeCallBack = 0; |
289 | if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>(); | 289 | if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>(); |
290 | sortmeth = Name; | 290 | sortmeth = Name; |
291 | hidden.setAutoDelete(TRUE); | 291 | hidden.setAutoDelete(TRUE); |
292 | ike = FALSE; | 292 | ike = FALSE; |
293 | calculateGrid( Bottom ); | 293 | calculateGrid( Bottom ); |
294 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); | 294 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); |
295 | Config config( "Launcher" ); | 295 | Config config( "Launcher" ); |
296 | config.setGroup( "GUI" ); | 296 | config.setGroup( "GUI" ); |
297 | staticBackground = config.readEntry( "StaticBackground", false ); | 297 | setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) ); |
298 | if ( staticBackground ) | ||
299 | { | ||
300 | setStaticBackground( true ); | ||
301 | verticalScrollBar()->setTracking( false ); | ||
302 | } | ||
303 | } | 298 | } |
304 | 299 | ||
305 | LauncherIconView::~LauncherIconView() | 300 | LauncherIconView::~LauncherIconView() |
306 | { | 301 | { |
307 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; | 302 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; |
308 | #if 0 // debuggery | 303 | #if 0 // debuggery |
309 | QListIterator<AppLnk> it(hidden); | 304 | QListIterator<AppLnk> it(hidden); |
310 | AppLnk* l; | 305 | AppLnk* l; |
311 | while ((l=it.current())) { | 306 | while ((l=it.current())) { |
312 | ++it; | 307 | ++it; |
313 | //odebug << "" << l << ": hidden (should remove)" << oendl; | 308 | //odebug << "" << l << ": hidden (should remove)" << oendl; |
314 | } | 309 | } |
315 | #endif | 310 | #endif |
316 | } | 311 | } |
317 | 312 | ||
313 | void LauncherIconView::setStaticBackgroundPicture( bool enable ) | ||
314 | { | ||
315 | staticBackground = enable; | ||
316 | if ( staticBackground ) | ||
317 | { | ||
318 | setStaticBackground( true ); | ||
319 | verticalScrollBar()->setTracking( false ); | ||
320 | } | ||
321 | else | ||
322 | { | ||
323 | setStaticBackground( false ); | ||
324 | verticalScrollBar()->setTracking( true ); | ||
325 | } | ||
326 | } | ||
327 | |||
318 | int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) | 328 | int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) |
319 | { | 329 | { |
320 | switch (sortmeth) { | 330 | switch (sortmeth) { |
321 | case Name: | 331 | case Name: |
322 | return a->name().lower().compare(b->name().lower()); | 332 | return a->name().lower().compare(b->name().lower()); |
323 | case Date: { | 333 | case Date: { |
324 | QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file()); | 334 | QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file()); |
325 | QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); | 335 | QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); |
326 | return fa.lastModified().secsTo(fb.lastModified()); | 336 | return fa.lastModified().secsTo(fb.lastModified()); |
327 | } | 337 | } |
328 | case Type: | 338 | case Type: |
329 | return a->type().compare(b->type()); | 339 | return a->type().compare(b->type()); |
@@ -361,30 +371,30 @@ void LauncherIconView::setItemTextPos( ItemTextPos pos ) | |||
361 | } | 371 | } |
362 | 372 | ||
363 | void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) | 373 | void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) |
364 | { | 374 | { |
365 | if ( bgPixmap.isNull() ) | 375 | if ( bgPixmap.isNull() ) |
366 | { | 376 | { |
367 | p->fillRect( r, bgColor ); | 377 | p->fillRect( r, bgColor ); |
368 | } | 378 | } |
369 | else | 379 | else |
370 | { | 380 | { |
371 | if ( staticBackground ) | 381 | if ( staticBackground ) |
372 | { | 382 | { |
373 | p->drawPixmap( r.x(), r.y(), bgPixmap, r.x(), r.y(), r.width(), r.height() ); | 383 | p->drawTiledPixmap( r, bgPixmap, QPoint( r.x() % bgPixmap.width(), r.y() % bgPixmap.height() ) ); |
374 | } | 384 | } |
375 | else | 385 | else |
376 | { | 386 | { |
377 | p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), | 387 | p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), |
378 | (r.y() + contentsY()) % bgPixmap.height() ) ); | 388 | (r.y() + contentsY()) % bgPixmap.height() ) ); |
379 | } | 389 | } |
380 | } | 390 | } |
381 | } | 391 | } |
382 | 392 | ||
383 | void LauncherIconView::addCatsAndMimes(AppLnk* app) | 393 | void LauncherIconView::addCatsAndMimes(AppLnk* app) |
384 | { | 394 | { |
385 | // QStringList c = app->categories(); | 395 | // QStringList c = app->categories(); |
386 | // for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) { | 396 | // for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) { |
387 | // cats.replace(*cit,(void*)1); | 397 | // cats.replace(*cit,(void*)1); |
388 | // } | 398 | // } |
389 | QString maj=app->type(); | 399 | QString maj=app->type(); |
390 | int sl=maj.find('/'); | 400 | int sl=maj.find('/'); |