-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 22 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
2 files changed, 10 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 7d85d63..089ef6a 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -99,13 +99,15 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
99 | buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); | 99 | buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); |
100 | buttonMask.fill( 0 ); | 100 | buttonMask.fill( 0 ); |
101 | 101 | ||
102 | for ( int i = 0; i < 7; i++ ) { | 102 | for ( int i = 0; i < 7; i++ ) { |
103 | Button &button = buttons[ i ]; | ||
104 | |||
103 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); | 105 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); |
104 | masks[i] = new QBitmap( filename ); | 106 | button.mask = QBitmap( filename ); |
105 | 107 | ||
106 | if ( !masks[i]->isNull() ) { | 108 | if ( !button.mask.isNull() ) { |
107 | QImage imgMask = masks[i]->convertToImage(); | 109 | QImage imgMask = button.mask.convertToImage(); |
108 | uchar **dest = buttonMask.jumpTable(); | 110 | uchar **dest = buttonMask.jumpTable(); |
109 | for ( int y = 0; y < imgUp.height(); y++ ) { | 111 | for ( int y = 0; y < imgUp.height(); y++ ) { |
110 | uchar *line = dest[y]; | 112 | uchar *line = dest[y]; |
111 | for ( int x = 0; x < imgUp.width(); x++ ) { | 113 | for ( int x = 0; x < imgUp.width(); x++ ) { |
@@ -138,18 +140,12 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
138 | } | 140 | } |
139 | 141 | ||
140 | 142 | ||
141 | VideoWidget::~VideoWidget() { | 143 | VideoWidget::~VideoWidget() { |
142 | |||
143 | for ( int i = 0; i < 7; i++ ) { | 144 | for ( int i = 0; i < 7; i++ ) { |
144 | delete buttonPixUp[i]; | 145 | delete buttonPixUp[i]; |
145 | delete buttonPixDown[i]; | 146 | delete buttonPixDown[i]; |
146 | } | 147 | } |
147 | |||
148 | for ( int i = 0; i < 7; i++ ) { | ||
149 | delete masks[i]; | ||
150 | } | ||
151 | |||
152 | } | 148 | } |
153 | 149 | ||
154 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 150 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
155 | QPixmap pix( img.width(), img.height() ); | 151 | QPixmap pix( img.width(), img.height() ); |
@@ -187,13 +183,15 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { | |||
187 | QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p ); | 183 | QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p ); |
188 | QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p ); | 184 | QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p ); |
189 | 185 | ||
190 | for ( int i = 0; i < 7; i++ ) { | 186 | for ( int i = 0; i < 7; i++ ) { |
191 | if ( !masks[i]->isNull() ) { | 187 | Button &button = buttons[ i ]; |
188 | |||
189 | if ( !button.mask.isNull() ) { | ||
192 | delete buttonPixUp[i]; | 190 | delete buttonPixUp[i]; |
193 | delete buttonPixDown[i]; | 191 | delete buttonPixDown[i]; |
194 | buttonPixUp[i] = maskVPixToMask( *pixUp, *masks[i] ); | 192 | buttonPixUp[i] = maskVPixToMask( *pixUp, button.mask ); |
195 | buttonPixDown[i] = maskVPixToMask( *pixDn, *masks[i] ); | 193 | buttonPixDown[i] = maskVPixToMask( *pixDn, button.mask ); |
196 | } | 194 | } |
197 | } | 195 | } |
198 | 196 | ||
199 | delete pixUp; | 197 | delete pixUp; |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index cb6171c..fd301f9 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -99,13 +99,11 @@ private: | |||
99 | // Ticker songInfo; | 99 | // Ticker songInfo; |
100 | QPixmap pixBg; | 100 | QPixmap pixBg; |
101 | QImage imgUp; | 101 | QImage imgUp; |
102 | QImage imgDn; | 102 | QImage imgDn; |
103 | QBitmap *masks[7]; | ||
104 | QPixmap *buttonPixUp[7]; | 103 | QPixmap *buttonPixUp[7]; |
105 | QPixmap *buttonPixDown[7]; | 104 | QPixmap *buttonPixDown[7]; |
106 | QString skin; | 105 | QString skin; |
107 | // QPixmap *pixmaps[4]; | ||
108 | 106 | ||
109 | 107 | ||
110 | virtual void paintButton( QPainter &p, int i ); | 108 | virtual void paintButton( QPainter &p, int i ); |
111 | void setToggleButton( int, bool ); | 109 | void setToggleButton( int, bool ); |