summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 14:29:48 (UTC)
committer simon <simon>2002-12-09 14:29:48 (UTC)
commit3f88070b9be5209cdd88caa0afd7f7294d3b1764 (patch) (unidiff)
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
110 110
111 masks.reserve( buttonCount ); 111 for ( uint i = 0; i < buttons.size(); i++ ) {
112
113 for ( uint i = 0; i < masks.capacity(); i++ ) {
114 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" ); 112 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" );
115 masks.push_back( QBitmap( filename ) ); 113 buttons[ i ].mask =QBitmap( filename );
116 114
117 if ( !masks[i].isNull() ) { 115 if ( !buttons[i].mask.isNull() ) {
118 QImage imgMask = masks[i].convertToImage(); 116 QImage imgMask = buttons[i].mask.convertToImage();
119 uchar **dest = buttonMask.jumpTable(); 117 uchar **dest = buttonMask.jumpTable();
@@ -129,5 +127,2 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
129 127
130 buttonPixUp.resize( masks.size(), QPixmap() );
131 buttonPixDown.resize( masks.size(), QPixmap() );
132
133 setBackgroundPixmap( pixBg ); 128 setBackgroundPixmap( pixBg );
@@ -217,6 +212,6 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
217 212
218 for ( uint i = 0; i < masks.size(); i++ ) { 213 for ( uint i = 0; i < buttons.size(); i++ ) {
219 if ( !masks[i].isNull() ) { 214 if ( !buttons[i].mask.isNull() ) {
220 buttonPixUp[i] = maskPixToMask( pixUp, masks[i] ); 215 buttons[i].pixUp = maskPixToMask( pixUp, buttons[i].mask );
221 buttonPixDown[i] = maskPixToMask( pixDn, masks[i] ); 216 buttons[i].pixDown = maskPixToMask( pixDn, buttons[i].mask );
222 } 217 }
@@ -324,5 +319,5 @@ void AudioWidget::paintButton( QPainter &p, int i ) {
324 if ( buttons[i].isDown ) { 319 if ( buttons[i].isDown ) {
325 p.drawPixmap( upperLeftOfButtonMask, buttonPixDown[i] ); 320 p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixDown );
326 } else { 321 } else {
327 p.drawPixmap( upperLeftOfButtonMask, buttonPixUp[i] ); 322 p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixUp );
328 } 323 }
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 @@
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qmap.h>
27 28
@@ -46,2 +47,6 @@ public:
46 bool isDown : 1; 47 bool isDown : 1;
48
49 QBitmap mask;
50 QPixmap pixUp;
51 QPixmap pixDown;
47 }; 52 };
@@ -92,6 +97,2 @@ protected:
92 97
93 MaskVector masks;
94 PixmapVector buttonPixUp;
95 PixmapVector buttonPixDown;
96
97 QPoint upperLeftOfButtonMask; 98 QPoint upperLeftOfButtonMask;