-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 8 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 24 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 3 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 11 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.h | 2 |
6 files changed, 40 insertions, 10 deletions
@@ -2,6 +2,8 @@ New Features ------------ + * Launcher: Support a static background pixmap (mickeyl) + * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) Fixed Bugs ---------- 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,7 +380,7 @@ 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 { 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) 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 @@ -84,6 +84,9 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); 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 ); + p1-> setEnabled ( false ); p3-> setEnabled ( false ); @@ -95,6 +98,7 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); 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." )); } void TabsSettings::init ( ) @@ -122,6 +126,7 @@ void TabsSettings::init ( ) cfg. setGroup ( "GUI" ); m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); + m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) ); } @@ -279,13 +284,17 @@ void TabsSettings::accept ( ) cfg. setGroup ( "GUI" ); QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); cfg. writeEntry ( "BusyType", busytype ); - cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); + cfg. writeEntry ( "StaticBackground", m_staticbackground->isChecked( ) ); { QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); e << busytype; } + { + QCopEnvelope e ( "QPE/Launcher", "setStaticBackground(bool)" ); + e << m_staticbackground->isChecked(); + } } void TabsSettings::newClicked ( ) 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 @@ -59,7 +59,7 @@ private: // QString currentTab; QStringList m_ids; QMap <QString, TabConfig> m_tabs; - QCheckBox *m_busyani, *m_bigbusy; + QCheckBox *m_busyani, *m_bigbusy, *m_staticbackground; }; |