summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp32
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h2
2 files changed, 12 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 089ef6a..3baa087 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -119,9 +119,4 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
119 } 119 }
120 120
121 for ( int i = 0; i < 7; i++ ) {
122 buttonPixUp[i] = NULL;
123 buttonPixDown[i] = NULL;
124 }
125
126 setBackgroundPixmap( pixBg ); 121 setBackgroundPixmap( pixBg );
127 122
@@ -141,9 +136,6 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
141 136
142 137
143VideoWidget::~VideoWidget() { 138VideoWidget::~VideoWidget()
144 for ( int i = 0; i < 7; i++ ) { 139{
145 delete buttonPixUp[i];
146 delete buttonPixDown[i];
147 }
148} 140}
149 141
@@ -156,7 +148,7 @@ QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
156} 148}
157 149
158QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { 150QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) {
159 QPixmap *pixmap = new QPixmap( pix ); 151 QPixmap pixmap( pix );
160 pixmap->setMask( mask ); 152 pixmap.setMask( mask );
161 return pixmap; 153 return pixmap;
162} 154}
@@ -188,8 +180,6 @@ void VideoWidget::resizeEvent( QResizeEvent * ) {
188 180
189 if ( !button.mask.isNull() ) { 181 if ( !button.mask.isNull() ) {
190 delete buttonPixUp[i]; 182 button.pixUp = maskVPixToMask( *pixUp, button.mask );
191 delete buttonPixDown[i]; 183 button.pixDown = maskVPixToMask( *pixDn, button.mask );
192 buttonPixUp[i] = maskVPixToMask( *pixUp, button.mask );
193 buttonPixDown[i] = maskVPixToMask( *pixDn, button.mask );
194 } 184 }
195 } 185 }
@@ -261,8 +251,10 @@ void VideoWidget::setToggleButton( int i, bool down ) {
261void VideoWidget::paintButton( QPainter &p, int i ) { 251void VideoWidget::paintButton( QPainter &p, int i ) {
262 252
263 if ( buttons[i].isDown ) { 253 Button &button = buttons[ i ];
264 p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); 254
255 if ( button.isDown ) {
256 p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
265 } else { 257 } else {
266 p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); 258 p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
267 } 259 }
268} 260}
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index fd301f9..aeb6429 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -101,6 +101,4 @@ private:
101 QImage imgUp; 101 QImage imgUp;
102 QImage imgDn; 102 QImage imgDn;
103 QPixmap *buttonPixUp[7];
104 QPixmap *buttonPixDown[7];
105 QString skin; 103 QString skin;
106 104