summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 14:29:48 (UTC)
committer simon <simon>2002-12-09 14:29:48 (UTC)
commit3f88070b9be5209cdd88caa0afd7f7294d3b1764 (patch) (side-by-side diff)
treefe1c3c224e6d6930cef0756f4e23aded980d692f
parent8746877e7ed89fc4c227d5d79d63c35c69ceacd6 (diff)
downloadopie-3f88070b9be5209cdd88caa0afd7f7294d3b1764.zip
opie-3f88070b9be5209cdd88caa0afd7f7294d3b1764.tar.gz
opie-3f88070b9be5209cdd88caa0afd7f7294d3b1764.tar.bz2
- merged the separate mask and pixmap arrays into the Button structure
and the buttons vector
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp25
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h9
2 files changed, 15 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 6e9c14a..87e06ee 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -110,10 +110,8 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
- masks.reserve( buttonCount );
-
- for ( uint i = 0; i < masks.capacity(); i++ ) {
+ for ( uint i = 0; i < buttons.size(); i++ ) {
QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" );
- masks.push_back( QBitmap( filename ) );
+ buttons[ i ].mask =QBitmap( filename );
- if ( !masks[i].isNull() ) {
- QImage imgMask = masks[i].convertToImage();
+ if ( !buttons[i].mask.isNull() ) {
+ QImage imgMask = buttons[i].mask.convertToImage();
uchar **dest = buttonMask.jumpTable();
@@ -129,5 +127,2 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
- buttonPixUp.resize( masks.size(), QPixmap() );
- buttonPixDown.resize( masks.size(), QPixmap() );
-
setBackgroundPixmap( pixBg );
@@ -217,6 +212,6 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
- for ( uint i = 0; i < masks.size(); i++ ) {
- if ( !masks[i].isNull() ) {
- buttonPixUp[i] = maskPixToMask( pixUp, masks[i] );
- buttonPixDown[i] = maskPixToMask( pixDn, masks[i] );
+ for ( uint i = 0; i < buttons.size(); i++ ) {
+ if ( !buttons[i].mask.isNull() ) {
+ buttons[i].pixUp = maskPixToMask( pixUp, buttons[i].mask );
+ buttons[i].pixDown = maskPixToMask( pixDn, buttons[i].mask );
}
@@ -324,5 +319,5 @@ void AudioWidget::paintButton( QPainter &p, int i ) {
if ( buttons[i].isDown ) {
- p.drawPixmap( upperLeftOfButtonMask, buttonPixDown[i] );
+ p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixDown );
} else {
- p.drawPixmap( upperLeftOfButtonMask, buttonPixUp[i] );
+ p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixUp );
}
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 2641df6..504b705 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -26,2 +26,3 @@
#include <qwidget.h>
+#include <qmap.h>
@@ -46,2 +47,6 @@ public:
bool isDown : 1;
+
+ QBitmap mask;
+ QPixmap pixUp;
+ QPixmap pixDown;
};
@@ -92,6 +97,2 @@ protected:
- MaskVector masks;
- PixmapVector buttonPixUp;
- PixmapVector buttonPixDown;
-
QPoint upperLeftOfButtonMask;