author | llornkcor <llornkcor> | 2003-04-19 15:14:55 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-04-19 15:14:55 (UTC) |
commit | 89ced5d0c4f4ce89a11333d80aac2f8b81d97233 (patch) (side-by-side diff) | |
tree | c6cc7903731bd8a40db43a9d4fc0488daee46d9a | |
parent | b8ac94f049b5a2de9a3567ee60dd98139321a0cf (diff) | |
download | opie-89ced5d0c4f4ce89a11333d80aac2f8b81d97233.zip opie-89ced5d0c4f4ce89a11333d80aac2f8b81d97233.tar.gz opie-89ced5d0c4f4ce89a11333d80aac2f8b81d97233.tar.bz2 |
fix skin handling
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 3dfe182..a1973e9 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -58,65 +58,65 @@ MediaButton audioButtons[] = { { FALSE, FALSE, FALSE } // back }; const char *skin_mask_file_names[10] = { "play", "stop", "next", "prev", "up", "down", "loop", "playlist", "forward", "back" }; static void changeTextColor( QWidget *w ) { QPalette p = w->palette(); p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); w->setPalette( p ); } static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); qDebug("<<<<<audioWidget"); Config cfg("OpiePlayer"); cfg.setGroup("Options"); skin = cfg.readEntry("Skin","default"); //skin = "scaleTest"; // color of background, frame, degree of transparency // QString skinPath = "opieplayer/skins/" + skin; QString skinPath; skinPath = "opieplayer2/skins/" + skin; - if(!QDir(skinPath).exists()) + if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) skinPath = "opieplayer2/skins/default"; qDebug("skin path " + skinPath); pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); imgButtonMask->fill( 0 ); for ( int i = 0; i < 10; i++ ) { QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; masks[i] = new QBitmap( filename ); if ( !masks[i]->isNull() ) { QImage imgMask = masks[i]->convertToImage(); uchar **dest = imgButtonMask->jumpTable(); for ( int y = 0; y < imgUp->height(); y++ ) { uchar *line = dest[y]; for ( int x = 0; x < imgUp->width(); x++ ) if ( !qRed( imgMask.pixel( x, y ) ) ) line[x] = i + 1; } } } for ( int i = 0; i < 11; i++ ) { buttonPixUp[i] = NULL; buttonPixDown[i] = NULL; } |