-rw-r--r-- | core/launcher/launcherview.cpp | 29 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 7 |
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 | |||
@@ -287,16 +287,24 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) | |||
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" ); | ||
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 | ||
297 | LauncherIconView::~LauncherIconView() | 305 | LauncherIconView::~LauncherIconView() |
298 | { | 306 | { |
299 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; | 307 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; |
300 | #if 0 // debuggery | 308 | #if 0 // debuggery |
301 | QListIterator<AppLnk> it(hidden); | 309 | QListIterator<AppLnk> it(hidden); |
302 | AppLnk* l; | 310 | AppLnk* l; |
@@ -349,27 +357,36 @@ void LauncherIconView::setTypeFilter(const QString& typefilter, bool resort) | |||
349 | void LauncherIconView::setItemTextPos( ItemTextPos pos ) | 357 | void LauncherIconView::setItemTextPos( ItemTextPos pos ) |
350 | { | 358 | { |
351 | calculateGrid( pos ); | 359 | calculateGrid( pos ); |
352 | QIconView::setItemTextPos( pos ); | 360 | QIconView::setItemTextPos( pos ); |
353 | } | 361 | } |
354 | 362 | ||
355 | void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) | 363 | void 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 | ||
366 | void LauncherIconView::addCatsAndMimes(AppLnk* app) | 383 | void 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); |
371 | // } | 388 | // } |
372 | QString maj=app->type(); | 389 | QString maj=app->type(); |
373 | int sl=maj.find('/'); | 390 | int sl=maj.find('/'); |
374 | if (sl>=0) { | 391 | if (sl>=0) { |
375 | QString k; | 392 | QString k; |
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 | |||
@@ -32,18 +32,16 @@ class CategorySelect; | |||
32 | class LauncherIconView; | 32 | class LauncherIconView; |
33 | class LauncherItem; | 33 | class LauncherItem; |
34 | class QIconViewItem; | 34 | class QIconViewItem; |
35 | class QLabel; | 35 | class QLabel; |
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | class MenuButton; | 37 | class MenuButton; |
38 | class QComboBox; | 38 | class QComboBox; |
39 | 39 | ||
40 | |||
41 | |||
42 | enum BusyIndicatorType { | 40 | enum BusyIndicatorType { |
43 | BIT_Normal = 0, | 41 | BIT_Normal = 0, |
44 | BIT_Animated | 42 | BIT_Animated |
45 | }; | 43 | }; |
46 | 44 | ||
47 | class LauncherView : public QVBox | 45 | class LauncherView : public QVBox |
48 | { | 46 | { |
49 | Q_OBJECT | 47 | Q_OBJECT |
@@ -77,17 +75,17 @@ public: | |||
77 | void setBackgroundType( BackgroundType t, const QString & ); | 75 | void setBackgroundType( BackgroundType t, const QString & ); |
78 | BackgroundType backgroundType() const { return bgType; } | 76 | BackgroundType backgroundType() const { return bgType; } |
79 | 77 | ||
80 | void setTextColor( const QColor & ); | 78 | void setTextColor( const QColor & ); |
81 | QColor textColor() const { return textCol; } | 79 | QColor textColor() const { return textCol; } |
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); |
89 | 87 | ||
90 | signals: | 88 | signals: |
91 | void clicked( const AppLnk * ); | 89 | void clicked( const AppLnk * ); |
92 | void rightPressed( AppLnk * ); | 90 | void rightPressed( AppLnk * ); |
93 | 91 | ||
@@ -194,17 +192,17 @@ public: | |||
194 | bgPixmap = pm; | 192 | bgPixmap = pm; |
195 | } | 193 | } |
196 | 194 | ||
197 | void setBackgroundColor( const QColor &c ) { | 195 | void setBackgroundColor( const QColor &c ) { |
198 | bgColor = c; | 196 | bgColor = c; |
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); |
206 | 204 | ||
207 | void setTypeFilter(const QString& typefilter, bool resort); | 205 | void setTypeFilter(const QString& typefilter, bool resort); |
208 | void setCategoryFilter( int catfilter, bool resort ); | 206 | void setCategoryFilter( int catfilter, bool resort ); |
209 | 207 | ||
210 | enum SortMethod { Name, Date, Type }; | 208 | enum SortMethod { Name, Date, Type }; |
@@ -245,11 +243,12 @@ private: | |||
245 | QColor bgColor; | 243 | QColor bgColor; |
246 | LauncherThumbReceiver*m_EyeCallBack; | 244 | LauncherThumbReceiver*m_EyeCallBack; |
247 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 245 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
248 | QPixmap busyPix; | 246 | QPixmap busyPix; |
249 | #endif | 247 | #endif |
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 |