author | simon <simon> | 2002-12-08 22:26:34 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:26:34 (UTC) |
commit | 3b5f97272ded8a40da3853476371b4edc41d1a34 (patch) (side-by-side diff) | |
tree | cc965571aa2f8ca62bf859e49acc91b440b96f1a | |
parent | 5d3f3d429bb6247741a30c00a344302a2c9a20c0 (diff) | |
download | opie-3b5f97272ded8a40da3853476371b4edc41d1a34.zip opie-3b5f97272ded8a40da3853476371b4edc41d1a34.tar.gz opie-3b5f97272ded8a40da3853476371b4edc41d1a34.tar.bz2 |
- share the imgButtonMask member variable in the base class
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
5 files changed, 14 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index a9d5a88..022aa82 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -106,6 +106,6 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); - imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); - imgButtonMask.fill( 0 ); + buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); + buttonMask.fill( 0 ); for ( int i = 0; i < 10; i++ ) { @@ -115,5 +115,5 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye if ( !masks[i]->isNull() ) { QImage imgMask = masks[i]->convertToImage(); - uchar **dest = imgButtonMask.jumpTable(); + uchar **dest = buttonMask.jumpTable(); for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; @@ -385,7 +385,7 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { int y = event->pos().y() - yoff; - bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width() - && y < imgButtonMask.height() - && imgButtonMask.pixelIndex( x, y ) == i + 1 ); + bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width() + && y < buttonMask.height() + && buttonMask.pixelIndex( x, y ) == i + 1 ); if ( isOnButton && !buttons[i].isHeld ) { diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 52a358c..da22946 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -100,5 +100,4 @@ private: QImage imgUp; QImage imgDn; - QImage imgButtonMask; QBitmap *masks[10]; QPixmap *buttonPixUp[10]; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index b88d7e2..044ab6c 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -70,4 +70,6 @@ protected: ButtonVector buttons; + + QImage buttonMask; }; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 7838229..459f592 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -100,6 +100,6 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); - imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); - imgButtonMask.fill( 0 ); + buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); + buttonMask.fill( 0 ); for ( int i = 0; i < 7; i++ ) { @@ -109,5 +109,5 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye if ( !masks[i]->isNull() ) { QImage imgMask = masks[i]->convertToImage(); - uchar **dest = imgButtonMask.jumpTable(); + uchar **dest = buttonMask.jumpTable(); for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; @@ -286,7 +286,7 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { int y = event->pos().y() - yoff; - bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width() - && y < imgButtonMask.height() - && imgButtonMask.pixelIndex( x, y ) == i + 1 ); + bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width() + && y < buttonMask.height() + && buttonMask.pixelIndex( x, y ) == i + 1 ); if ( isOnButton && !buttons[i].isHeld ) { diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index f996803..a5500d7 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -101,5 +101,4 @@ private: QImage imgUp; QImage imgDn; - QImage imgButtonMask; QBitmap *masks[7]; QPixmap *buttonPixUp[7]; |