summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog2
-rw-r--r--core/launcher/launcher.cpp8
-rw-r--r--core/launcher/launcherview.cpp28
-rw-r--r--core/launcher/launcherview.h3
-rw-r--r--core/settings/launcher/tabssettings.cpp13
-rw-r--r--core/settings/launcher/tabssettings.h2
6 files changed, 43 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index fe763a5..8ac976d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,2 +4,4 @@
------------
+ * Launcher: Support a static background pixmap (mickeyl)
+ * LauncherSettings: Choose whether to have a static background pixmap (mickeyl)
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
@@ -458,2 +458,10 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
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
@@ -296,8 +296,3 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
config.setGroup( "GUI" );
- staticBackground = config.readEntry( "StaticBackground", false );
- if ( staticBackground )
- {
- setStaticBackground( true );
- verticalScrollBar()->setTracking( false );
- }
+ setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) );
}
@@ -317,2 +312,17 @@ LauncherIconView::~LauncherIconView()
+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)
@@ -372,3 +382,3 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
{
- 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() ) );
}
@@ -376,4 +386,4 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
{
- 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
@@ -84,4 +84,4 @@ public:
void setColNumber( int );
-
void relayout(void);
+ LauncherIconView* iconView() { return icons; };
@@ -171,2 +171,3 @@ public:
void setBusyIndicatorType ( BusyIndicatorType t );
+ void setStaticBackgroundPicture( bool enable );
void doAutoScroll()
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index 42f0568..fca6b20 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -85,2 +85,5 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 );
+
+ m_staticbackground = new QCheckBox( tr( "Enable static background pixmap" ), this );
+ lay->addMultiCellWidget( m_staticbackground, 7, 7, 0, 1 );
@@ -97,2 +100,3 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." ));
+ QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." ));
}
@@ -124,2 +128,3 @@ void TabsSettings::init ( )
m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) );
+ m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) );
}
@@ -281,4 +286,4 @@ void TabsSettings::accept ( )
cfg. writeEntry ( "BusyType", busytype );
-
- cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
+ cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
+ cfg. writeEntry ( "StaticBackground", m_staticbackground->isChecked( ) );
@@ -288,2 +293,6 @@ void TabsSettings::accept ( )
}
+ {
+ QCopEnvelope e ( "QPE/Launcher", "setStaticBackground(bool)" );
+ e << m_staticbackground->isChecked();
+ }
}
diff --git a/core/settings/launcher/tabssettings.h b/core/settings/launcher/tabssettings.h
index 600c65c..bbe1e72 100644
--- a/core/settings/launcher/tabssettings.h
+++ b/core/settings/launcher/tabssettings.h
@@ -61,3 +61,3 @@ private:
QMap <QString, TabConfig> m_tabs;
- QCheckBox *m_busyani, *m_bigbusy;
+ QCheckBox *m_busyani, *m_bigbusy, *m_staticbackground;
};