author | harlekin <harlekin> | 2003-11-30 18:04:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-11-30 18:04:13 (UTC) |
commit | f40b049e2345a9b008ea2bdc241062302bd7ca04 (patch) (side-by-side diff) | |
tree | 82ba2d954605de18ef063315b62f04f434ce43cb | |
parent | a7e786be4f9545a881015de8ba8a124a62f0f891 (diff) | |
download | opie-f40b049e2345a9b008ea2bdc241062302bd7ca04.zip opie-f40b049e2345a9b008ea2bdc241062302bd7ca04.tar.gz opie-f40b049e2345a9b008ea2bdc241062302bd7ca04.tar.bz2 |
make the busy indicator launcher settings also work in head
-rw-r--r-- | core/launcher/launcherview.cpp | 32 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 9 |
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 @@ -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() ); 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 @@ -35,4 +35,11 @@ class MenuButton; class QComboBox; + + +enum BusyIndicatorType { + BIT_Normal = 0, + BIT_Animated +}; + class LauncherView : public QVBox { @@ -107,5 +114,5 @@ private: QImage loadBackgroundImage(QString &fname); - int m_busyType; + }; |