summaryrefslogtreecommitdiff
path: root/core/launcher
authormickeyl <mickeyl>2005-02-16 19:20:06 (UTC)
committer mickeyl <mickeyl>2005-02-16 19:20:06 (UTC)
commit5ad21664e5db417a18682903a660f4651c68ff12 (patch) (unidiff)
tree12fc6b3e45b3575cf71c2b5dd1e26c4592f5381b /core/launcher
parent4fc6942eed4abdc0d4b5e1b3460a32852731c7b4 (diff)
downloadopie-5ad21664e5db417a18682903a660f4651c68ff12.zip
opie-5ad21664e5db417a18682903a660f4651c68ff12.tar.gz
opie-5ad21664e5db417a18682903a660f4651c68ff12.tar.bz2
this patch adds the possibility to have a static (as in non-scrolling) background
in the launcher. major drawback: most of our machines (at least the SA1100 based ones) are too slow to make it flicker free w/ tracking (repainting while dragging the scrollbar). so i needed to disable tracking for the static background. it's a hidden setting and disabled per default. please play around with it and give me your comments. How to enable: Launcher.conf: [GUI] StaticBackground = 1
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp29
-rw-r--r--core/launcher/launcherview.h7
2 files changed, 26 insertions, 10 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 2b34cc5..e7229ee 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -292,6 +292,14 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
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" );
296 config.setGroup( "GUI" );
297 staticBackground = config.readEntry( "StaticBackground", false );
298 if ( staticBackground )
299 {
300 setStaticBackground( true );
301 verticalScrollBar()->setTracking( false );
302 }
295} 303}
296 304
297LauncherIconView::~LauncherIconView() 305LauncherIconView::~LauncherIconView()
@@ -354,17 +362,26 @@ void LauncherIconView::setItemTextPos( ItemTextPos pos )
354 362
355void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) 363void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
356{ 364{
357 if ( !bgPixmap.isNull() ) { 365 if ( bgPixmap.isNull() )
358 p->drawTiledPixmap( r, bgPixmap, 366 {
359 QPoint( (r.x() + contentsX()) % bgPixmap.width(),
360 (r.y() + contentsY()) % bgPixmap.height() ) );
361 } else {
362 p->fillRect( r, bgColor ); 367 p->fillRect( r, bgColor );
363 } 368 }
369 else
370 {
371 if ( staticBackground )
372 {
373 p->drawPixmap( r.x(), r.y(), bgPixmap, r.x(), r.y(), r.width(), r.height() );
374 }
375 else
376 {
377 p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(),
378 (r.y() + contentsY()) % bgPixmap.height() ) );
379 }
380 }
364} 381}
365 382
366void LauncherIconView::addCatsAndMimes(AppLnk* app) 383void LauncherIconView::addCatsAndMimes(AppLnk* app)
367 { 384{
368 // QStringList c = app->categories(); 385 // QStringList c = app->categories();
369 // for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) { 386 // for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) {
370 // cats.replace(*cit,(void*)1); 387 // cats.replace(*cit,(void*)1);
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index e2869eb..97b1dea 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -37,8 +37,6 @@ class QWidgetStack;
37class MenuButton; 37class MenuButton;
38class QComboBox; 38class QComboBox;
39 39
40
41
42enum BusyIndicatorType { 40enum BusyIndicatorType {
43 BIT_Normal = 0, 41 BIT_Normal = 0,
44 BIT_Animated 42 BIT_Animated
@@ -82,7 +80,7 @@ public:
82 80
83 void setViewFont( const QFont & ); 81 void setViewFont( const QFont & );
84 void clearViewFont(); 82 void clearViewFont();
85 83
86 void setColNumber( int ); 84 void setColNumber( int );
87 85
88 void relayout(void); 86 void relayout(void);
@@ -199,7 +197,7 @@ public:
199 } 197 }
200 198
201 void setColNumber( int ); 199 void setColNumber( int );
202 200
203 void drawBackground( QPainter *p, const QRect &r ); 201 void drawBackground( QPainter *p, const QRect &r );
204 void setItemTextPos( ItemTextPos pos ); 202 void setItemTextPos( ItemTextPos pos );
205 void hideOrShowItems(bool resort); 203 void hideOrShowItems(bool resort);
@@ -250,6 +248,7 @@ private:
250 BusyIndicatorType busyType; 248 BusyIndicatorType busyType;
251 QTimer m_eyeTimer; 249 QTimer m_eyeTimer;
252 int numColumns; 250 int numColumns;
251 bool staticBackground;
253}; 252};
254 253
255#endif // LAUNCHERVIEW_H 254#endif // LAUNCHERVIEW_H