summaryrefslogtreecommitdiff
path: root/core/launcher
authormickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
committer mickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
commitfaaa7b79330fe3c5647182fafdb2bb584dc70638 (patch) (unidiff)
treeffa63faf248cf20f363b80b579855b124d34032f /core/launcher
parent766ac02e5586cd67b75b320fe1abee513384860c (diff)
downloadopie-faaa7b79330fe3c5647182fafdb2bb584dc70638.zip
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.gz
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.bz2
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
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp8
-rw-r--r--core/launcher/launcherview.cpp28
-rw-r--r--core/launcher/launcherview.h3
3 files changed, 29 insertions, 10 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 4255b44..4ec5f4c 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -456,6 +456,14 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
456 int id; stream >> id; 456 int id; stream >> id;
457 odebug << "Doctab enabled " << id << oendl; 457 odebug << "Doctab enabled " << id << oendl;
458 reCheckDoctab(id); 458 reCheckDoctab(id);
459 } else if ( msg == "setStaticBackground(bool)" ) {
460 int set; stream >> set;
461 odebug << "setStaticBackground " << set << oendl;
462 for (int i = 0; i < categoryBar->count(); i++ )
463 {
464 LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view;
465 view->iconView()->setStaticBackgroundPicture( set );
466 }
459 } 467 }
460} 468}
461 469
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 )
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()
@@ -315,6 +310,21 @@ LauncherIconView::~LauncherIconView()
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) {
@@ -370,12 +380,12 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
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}
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 97b1dea..6a2d197 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -82,8 +82,8 @@ public:
82 void clearViewFont(); 82 void clearViewFont();
83 83
84 void setColNumber( int ); 84 void setColNumber( int );
85
86 void relayout(void); 85 void relayout(void);
86 LauncherIconView* iconView() { return icons; };
87 87
88signals: 88signals:
89 void clicked( const AppLnk * ); 89 void clicked( const AppLnk * );
@@ -169,6 +169,7 @@ public:
169 void setBigIcons( bool bi ); 169 void setBigIcons( bool bi );
170 void updateCategoriesAndMimeTypes(); 170 void updateCategoriesAndMimeTypes();
171 void setBusyIndicatorType ( BusyIndicatorType t ); 171 void setBusyIndicatorType ( BusyIndicatorType t );
172 void setStaticBackgroundPicture( bool enable );
172 void doAutoScroll() 173 void doAutoScroll()
173 { 174 {
174 // We don't want rubberbanding (yet) 175 // We don't want rubberbanding (yet)