From faaa7b79330fe3c5647182fafdb2bb584dc70638 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 17 Feb 2005 14:26:43 +0000 Subject: The response to the static background pixmap was overwhelmingly positive, hence: * fix static background pixmap also for tiled pixmaps * make it customizable via LauncherSettings * enable it per default --- (limited to 'core/launcher/launcherview.cpp') 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 @@ -294,12 +294,7 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); Config config( "Launcher" ); config.setGroup( "GUI" ); - staticBackground = config.readEntry( "StaticBackground", false ); - if ( staticBackground ) - { - setStaticBackground( true ); - verticalScrollBar()->setTracking( false ); - } + setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) ); } LauncherIconView::~LauncherIconView() @@ -315,6 +310,21 @@ LauncherIconView::~LauncherIconView() #endif } +void LauncherIconView::setStaticBackgroundPicture( bool enable ) +{ + staticBackground = enable; + if ( staticBackground ) + { + setStaticBackground( true ); + verticalScrollBar()->setTracking( false ); + } + else + { + setStaticBackground( false ); + verticalScrollBar()->setTracking( true ); + } +} + int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) { switch (sortmeth) { @@ -370,12 +380,12 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) { if ( staticBackground ) { - p->drawPixmap( r.x(), r.y(), bgPixmap, r.x(), r.y(), r.width(), r.height() ); + p->drawTiledPixmap( r, bgPixmap, QPoint( r.x() % bgPixmap.width(), r.y() % bgPixmap.height() ) ); } else { - p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), - (r.y() + contentsY()) % bgPixmap.height() ) ); + p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(), + (r.y() + contentsY()) % bgPixmap.height() ) ); } } } -- cgit v0.9.0.2