summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp32
-rw-r--r--core/launcher/launcherview.h9
2 files changed, 29 insertions, 12 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 85163b6..62c678d 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -62,10 +62,6 @@ public:
62 int ref; 62 int ref;
63}; 63};
64 64
65enum BusyIndicatorType {
66 BIT_Normal = 0,
67 BIT_Blinking
68};
69 65
70static QMap<QString,BgPixmap*> *bgCache = 0; 66static QMap<QString,BgPixmap*> *bgCache = 0;
71 67
@@ -97,12 +93,15 @@ public:
97 93
98 virtual int compare ( QIconViewItem * i ) const; 94 virtual int compare ( QIconViewItem * i ) const;
99 void paintItem( QPainter *p, const QColorGroup &cg ); 95 void paintItem( QPainter *p, const QColorGroup &cg );
96
97 void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
100protected: 98protected:
101 bool isBigIcon; 99 bool isBigIcon;
102 int iteration; 100 int iteration;
103 AppLnk* app; 101 AppLnk* app;
104private: 102private:
105 void paintAnimatedIcon( QPainter *p ); 103 void paintAnimatedIcon( QPainter *p );
104 BusyIndicatorType busyType;
106}; 105};
107 106
108 107
@@ -147,8 +146,8 @@ public:
147 } 146 }
148 147
149 void updateCategoriesAndMimeTypes(); 148 void updateCategoriesAndMimeTypes();
150 149 void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
151 void doAutoScroll() 150 void doAutoScroll()
152 { 151 {
153 // We don't want rubberbanding (yet) 152 // We don't want rubberbanding (yet)
154 } 153 }
@@ -176,10 +175,13 @@ public:
176 if ( bsy != c ) { 175 if ( bsy != c ) {
177 LauncherItem *oldBusy = bsy; 176 LauncherItem *oldBusy = bsy;
178 bsy = c; 177 bsy = c;
179 if ( oldBusy ) 178 if ( oldBusy ) {
180 oldBusy->resetIcon(); 179 oldBusy->resetIcon();
181 if ( bsy ) 180 }
181 if ( bsy ) {
182 bsy->setBusyIndicatorType( busyType ) ;
182 bsy->animateIcon(); 183 bsy->animateIcon();
184 }
183 } 185 }
184 } 186 }
185 187
@@ -363,6 +365,7 @@ private:
363#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY 365#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
364 QPixmap busyPix; 366 QPixmap busyPix;
365#endif 367#endif
368 BusyIndicatorType busyType;
366}; 369};
367 370
368 371
@@ -374,7 +377,10 @@ void LauncherView::setBusy(bool on)
374} 377}
375 378
376void LauncherView::setBusyIndicatorType( const QString& type ) { 379void LauncherView::setBusyIndicatorType( const QString& type ) {
377 /* ### FIXME */ 380 if ( type. lower ( ) == "animated" )
381 icons->setBusyIndicatorType( BIT_Animated ) ;
382 else
383 icons->setBusyIndicatorType( BIT_Normal ) ;
378} 384}
379 385
380LauncherItem::LauncherItem( QIconView *parent, AppLnk *applnk, bool bigIcon ) 386LauncherItem::LauncherItem( QIconView *parent, AppLnk *applnk, bool bigIcon )
@@ -420,6 +426,8 @@ void LauncherItem::paintItem( QPainter *p, const QColorGroup &cg )
420 liv->setItemTextBackground( oldBrush ); 426 liv->setItemTextBackground( oldBrush );
421} 427}
422 428
429
430
423void LauncherItem::paintAnimatedIcon( QPainter *p ) 431void LauncherItem::paintAnimatedIcon( QPainter *p )
424{ 432{
425 LauncherIconView* liv = (LauncherIconView*)iconView(); 433 LauncherIconView* liv = (LauncherIconView*)iconView();
@@ -440,8 +448,10 @@ void LauncherItem::paintAnimatedIcon( QPainter *p )
440 liv->drawBackground( &p2, QRect(x1,y1,w,h+4) ); 448 liv->drawBackground( &p2, QRect(x1,y1,w,h+4) );
441 int bounceY = 2; 449 int bounceY = 2;
442#ifdef BOUNCE_BUSY_ICON 450#ifdef BOUNCE_BUSY_ICON
443 bounceY = 4 - ((iteration+2)%8); 451 if ( busyType == BIT_Animated ) {
444 bounceY = bounceY < 0 ? -bounceY : bounceY; 452 bounceY = 4 - ((iteration+2)%8);
453 bounceY = bounceY < 0 ? -bounceY : bounceY;
454 }
445#endif 455#endif
446 p2.drawPixmap( x1, y1 + bounceY, *pixmap() ); 456 p2.drawPixmap( x1, y1 + bounceY, *pixmap() );
447#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY 457#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 7863d6a..e40a006 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -34,6 +34,13 @@ class QWidgetStack;
34class MenuButton; 34class MenuButton;
35class QComboBox; 35class QComboBox;
36 36
37
38
39enum BusyIndicatorType {
40 BIT_Normal = 0,
41 BIT_Animated
42};
43
37class LauncherView : public QVBox 44class LauncherView : public QVBox
38{ 45{
39 Q_OBJECT 46 Q_OBJECT
@@ -106,7 +113,7 @@ private:
106 QColor textCol; 113 QColor textCol;
107 114
108 QImage loadBackgroundImage(QString &fname); 115 QImage loadBackgroundImage(QString &fname);
109 int m_busyType; 116
110}; 117};
111 118
112#endif // LAUNCHERVIEW_H 119#endif // LAUNCHERVIEW_H