Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/launcherview.cpp | 32 |
1 files changed, 21 insertions, 11 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 @@ -63,8 +63,4 @@ public: }; -enum BusyIndicatorType { - BIT_Normal = 0, - BIT_Blinking -}; static QMap<QString,BgPixmap*> *bgCache = 0; @@ -98,4 +94,6 @@ public: virtual int compare ( QIconViewItem * i ) const; void paintItem( QPainter *p, const QColorGroup &cg ); + + void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } protected: bool isBigIcon; @@ -104,4 +102,5 @@ protected: private: void paintAnimatedIcon( QPainter *p ); + BusyIndicatorType busyType; }; @@ -148,6 +147,6 @@ public: void updateCategoriesAndMimeTypes(); - - void doAutoScroll() + void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } + void doAutoScroll() { // We don't want rubberbanding (yet) @@ -177,8 +176,11 @@ public: LauncherItem *oldBusy = bsy; bsy = c; - if ( oldBusy ) + if ( oldBusy ) { oldBusy->resetIcon(); - if ( bsy ) + } + if ( bsy ) { + bsy->setBusyIndicatorType( busyType ) ; bsy->animateIcon(); + } } } @@ -364,4 +366,5 @@ private: QPixmap busyPix; #endif + BusyIndicatorType busyType; }; @@ -375,5 +378,8 @@ void LauncherView::setBusy(bool on) void LauncherView::setBusyIndicatorType( const QString& type ) { - /* ### FIXME */ + if ( type. lower ( ) == "animated" ) + icons->setBusyIndicatorType( BIT_Animated ) ; + else + icons->setBusyIndicatorType( BIT_Normal ) ; } @@ -421,4 +427,6 @@ void LauncherItem::paintItem( QPainter *p, const QColorGroup &cg ) } + + void LauncherItem::paintAnimatedIcon( QPainter *p ) { @@ -441,6 +449,8 @@ void LauncherItem::paintAnimatedIcon( QPainter *p ) int bounceY = 2; #ifdef BOUNCE_BUSY_ICON - bounceY = 4 - ((iteration+2)%8); - bounceY = bounceY < 0 ? -bounceY : bounceY; + if ( busyType == BIT_Animated ) { + bounceY = 4 - ((iteration+2)%8); + bounceY = bounceY < 0 ? -bounceY : bounceY; + } #endif p2.drawPixmap( x1, y1 + bounceY, *pixmap() ); |