author | simon <simon> | 2002-12-09 14:41:19 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 14:41:19 (UTC) |
commit | 174c4a427750a3829ffd81a87454be8abf61ee30 (patch) (side-by-side diff) | |
tree | e6b8d73afe4426707698396cc3c0086d712983f9 | |
parent | 3f88070b9be5209cdd88caa0afd7f7294d3b1764 (diff) | |
download | opie-174c4a427750a3829ffd81a87454be8abf61ee30.zip opie-174c4a427750a3829ffd81a87454be8abf61ee30.tar.gz opie-174c4a427750a3829ffd81a87454be8abf61ee30.tar.bz2 |
- merged the two button setup loops
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 87e06ee..c148820 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -73,69 +73,67 @@ const MediaWidget::SkinButtonInfo skinInfo[] = const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); 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 ); } } AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), audioSliderBeingMoved( false ) { - for ( uint i = 0; i < buttonCount; ++i ) { - Button button; - button.type = skinInfo[ i ].type; - buttons.push_back( button ); - } - setCaption( tr("OpiePlayer") ); Config cfg("OpiePlayer"); cfg.setGroup("Options"); skin = cfg.readEntry("Skin","default"); //skin = "scaleTest"; // color of background, frame, degree of transparency QString skinPath = "opieplayer2/skins/" + skin; pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); buttonMask.fill( 0 ); - for ( uint i = 0; i < buttons.size(); i++ ) { + for ( uint i = 0; i < buttonCount; i++ ) { + Button button; + button.type = skinInfo[ i ].type; + QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" ); - buttons[ i ].mask =QBitmap( filename ); + button.mask =QBitmap( filename ); - if ( !buttons[i].mask.isNull() ) { - QImage imgMask = buttons[i].mask.convertToImage(); + if ( !button.mask.isNull() ) { + QImage imgMask = button.mask.convertToImage(); uchar **dest = buttonMask.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; } } + buttons.push_back( button ); } setBackgroundPixmap( pixBg ); songInfo.setFocusPolicy( QWidget::NoFocus ); // changeTextColor( &songInfo ); // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); // songInfo.setFrameStyle( QFrame::NoFrame); songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); // songInfo.setForegroundColor(Qt::white); slider.setFixedHeight( 20 ); slider.setMinValue( 0 ); slider.setMaxValue( 1 ); slider.setFocusPolicy( QWidget::NoFocus ); slider.setBackgroundPixmap( pixBg ); |