summaryrefslogtreecommitdiff
path: root/core/launcher
authormickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
committer mickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
commitfaaa7b79330fe3c5647182fafdb2bb584dc70638 (patch) (side-by-side diff)
treeffa63faf248cf20f363b80b579855b124d34032f /core/launcher
parent766ac02e5586cd67b75b320fe1abee513384860c (diff)
downloadopie-faaa7b79330fe3c5647182fafdb2bb584dc70638.zip
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.gz
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.bz2
The response to the static background pixmap was overwhelmingly positive, hence:
* fix static background pixmap also for tiled pixmaps * make it customizable via LauncherSettings * enable it per default
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp8
-rw-r--r--core/launcher/launcherview.cpp28
-rw-r--r--core/launcher/launcherview.h3
3 files changed, 29 insertions, 10 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 4255b44..4ec5f4c 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -456,6 +456,14 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
int id; stream >> id;
odebug << "Doctab enabled " << id << oendl;
reCheckDoctab(id);
+ } else if ( msg == "setStaticBackground(bool)" ) {
+ int set; stream >> set;
+ odebug << "setStaticBackground " << set << oendl;
+ for (int i = 0; i < categoryBar->count(); i++ )
+ {
+ LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view;
+ view->iconView()->setStaticBackgroundPicture( set );
+ }
}
}
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index e7229ee..a4c7561 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -294,12 +294,7 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer()));
Config config( "Launcher" );
config.setGroup( "GUI" );
- staticBackground = config.readEntry( "StaticBackground", false );
- if ( staticBackground )
- {
- setStaticBackground( true );
- verticalScrollBar()->setTracking( false );
- }
+ setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) );
}
LauncherIconView::~LauncherIconView()
@@ -315,6 +310,21 @@ LauncherIconView::~LauncherIconView()
#endif
}
+void LauncherIconView::setStaticBackgroundPicture( bool enable )
+{
+ staticBackground = enable;
+ if ( staticBackground )
+ {
+ setStaticBackground( true );
+ verticalScrollBar()->setTracking( false );
+ }
+ else
+ {
+ setStaticBackground( false );
+ verticalScrollBar()->setTracking( true );
+ }
+}
+
int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
{
switch (sortmeth) {
@@ -370,12 +380,12 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
{
if ( staticBackground )
{
- p->drawPixmap( r.x(), r.y(), bgPixmap, r.x(), r.y(), r.width(), r.height() );
+ p->drawTiledPixmap( r, bgPixmap, QPoint( r.x() % bgPixmap.width(), r.y() % bgPixmap.height() ) );
}
else
{
- p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(),
- (r.y() + contentsY()) % bgPixmap.height() ) );
+ p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(),
+ (r.y() + contentsY()) % bgPixmap.height() ) );
}
}
}
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 97b1dea..6a2d197 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -82,8 +82,8 @@ public:
void clearViewFont();
void setColNumber( int );
-
void relayout(void);
+ LauncherIconView* iconView() { return icons; };
signals:
void clicked( const AppLnk * );
@@ -169,6 +169,7 @@ public:
void setBigIcons( bool bi );
void updateCategoriesAndMimeTypes();
void setBusyIndicatorType ( BusyIndicatorType t );
+ void setStaticBackgroundPicture( bool enable );
void doAutoScroll()
{
// We don't want rubberbanding (yet)