-rw-r--r-- | core/launcher/launcherview.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 6354bb7..1598d13 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -33,33 +33,41 @@ #include <qtimer.h> #include <qdict.h> #include <qfile.h> #include <qfileinfo.h> #include <qhbox.h> #include <qiconview.h> #include <qpainter.h> #include <qregexp.h> #include <qtoolbutton.h> class LauncherIconView : public QIconView { public: + QColor iconText; + QColor background; + LauncherIconView( QWidget* parent, const char* name=0 ) : QIconView(parent,name), tf(""), cf(0), bsy(0) { sortmeth = Name; hidden.setAutoDelete(TRUE); ike = FALSE; + + Config config( "qpe" ); + config.setGroup( "Appearance" ); + iconText = QColor( config.readEntry( "LauncherIconText", "#000000" ) ); + background = QColor( config.readEntry( "LauncherBackground", "#FFFFFF" ) ); } ~LauncherIconView() { #if 0 // debuggery QListIterator<AppLnk> it(hidden); AppLnk* l; while ((l=it.current())) { ++it; //qDebug("%p: hidden (should remove)",l); } #endif @@ -138,25 +146,26 @@ public: // Double buffer the background static QPixmap *bg = NULL; static QColor bgColor; if ( (bg == NULL) || (bgColor != colorGroup().button()) ) { // Create a new background double buffer if (bg == NULL) bg = new QPixmap( width(), height() ); bgColor = colorGroup().button(); QPainter painter( bg ); - painter.fillRect( QRect( 0, 0, width(), height() ), colorGroup().background().light(110)); +// painter.fillRect( QRect( 0, 0, width(), height() ), colorGroup().background().light(110)); + painter.fillRect( QRect( 0, 0, width(), height() ), background); // Overlay the Qtopia logo in the center QImage logo; if (QFile::exists(backgroundImage)) { logo = QImage(backgroundImage); } else { logo = Resource::loadImage(backgroundImage ); } if ( !logo.isNull() ) painter.drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); } @@ -278,24 +287,28 @@ public: virtual int compare ( QIconViewItem * i ) const; void paintItem( QPainter *p, const QColorGroup &cg ) { LauncherIconView* liv = (LauncherIconView*)iconView(); QBrush oldBrush( liv->itemTextBackground() ); QColorGroup mycg( cg ); if ( liv->currentItem() == this ) { liv->setItemTextBackground( cg.brush( QColorGroup::Highlight ) ); mycg.setColor( QColorGroup::Text, cg.color( QColorGroup::HighlightedText ) ); } + else { + mycg.setColor( QColorGroup::Text, liv->iconText ); + } + QIconViewItem::paintItem(p,mycg); if ( liv->currentItem() == this ) liv->setItemTextBackground( oldBrush ); if ( liv->busyItem() == this ) { static QPixmap* busypm=0; if ( !busypm ) busypm = new QPixmap(Resource::loadPixmap("launching")); p->drawPixmap(x()+(width()-busypm->width())/2, y(),*busypm); } } protected: |