summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2003-11-30 18:04:13 (UTC)
committer harlekin <harlekin>2003-11-30 18:04:13 (UTC)
commitf40b049e2345a9b008ea2bdc241062302bd7ca04 (patch) (side-by-side diff)
tree82ba2d954605de18ef063315b62f04f434ce43cb /core
parenta7e786be4f9545a881015de8ba8a124a62f0f891 (diff)
downloadopie-f40b049e2345a9b008ea2bdc241062302bd7ca04.zip
opie-f40b049e2345a9b008ea2bdc241062302bd7ca04.tar.gz
opie-f40b049e2345a9b008ea2bdc241062302bd7ca04.tar.bz2
make the busy indicator launcher settings also work in head
Diffstat (limited to 'core') (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:
int ref;
};
-enum BusyIndicatorType {
- BIT_Normal = 0,
- BIT_Blinking
-};
static QMap<QString,BgPixmap*> *bgCache = 0;
@@ -97,12 +93,15 @@ public:
virtual int compare ( QIconViewItem * i ) const;
void paintItem( QPainter *p, const QColorGroup &cg );
+
+ void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
protected:
bool isBigIcon;
int iteration;
AppLnk* app;
private:
void paintAnimatedIcon( QPainter *p );
+ BusyIndicatorType busyType;
};
@@ -147,8 +146,8 @@ public:
}
void updateCategoriesAndMimeTypes();
-
- void doAutoScroll()
+ void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
+ void doAutoScroll()
{
// We don't want rubberbanding (yet)
}
@@ -176,10 +175,13 @@ public:
if ( bsy != c ) {
LauncherItem *oldBusy = bsy;
bsy = c;
- if ( oldBusy )
+ if ( oldBusy ) {
oldBusy->resetIcon();
- if ( bsy )
+ }
+ if ( bsy ) {
+ bsy->setBusyIndicatorType( busyType ) ;
bsy->animateIcon();
+ }
}
}
@@ -363,6 +365,7 @@ private:
#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
QPixmap busyPix;
#endif
+ BusyIndicatorType busyType;
};
@@ -374,7 +377,10 @@ 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 ) ;
}
LauncherItem::LauncherItem( QIconView *parent, AppLnk *applnk, bool bigIcon )
@@ -420,6 +426,8 @@ void LauncherItem::paintItem( QPainter *p, const QColorGroup &cg )
liv->setItemTextBackground( oldBrush );
}
+
+
void LauncherItem::paintAnimatedIcon( QPainter *p )
{
LauncherIconView* liv = (LauncherIconView*)iconView();
@@ -440,8 +448,10 @@ void LauncherItem::paintAnimatedIcon( QPainter *p )
liv->drawBackground( &p2, QRect(x1,y1,w,h+4) );
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() );
#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;
class MenuButton;
class QComboBox;
+
+
+enum BusyIndicatorType {
+ BIT_Normal = 0,
+ BIT_Animated
+};
+
class LauncherView : public QVBox
{
Q_OBJECT
@@ -106,7 +113,7 @@ private:
QColor textCol;
QImage loadBackgroundImage(QString &fname);
- int m_busyType;
+
};
#endif // LAUNCHERVIEW_H