summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
Unidiff
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp28
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
@@ -293,14 +293,9 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
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
305LauncherIconView::~LauncherIconView() 300LauncherIconView::~LauncherIconView()
306{ 301{
@@ -314,8 +309,23 @@ LauncherIconView::~LauncherIconView()
314 } 309 }
315#endif 310#endif
316} 311}
317 312
313void 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
318int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) 328int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
319{ 329{
320 switch (sortmeth) { 330 switch (sortmeth) {
321 case Name: 331 case Name:
@@ -369,14 +379,14 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
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