author | simon <simon> | 2002-12-09 15:04:10 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 15:04:10 (UTC) |
commit | dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa (patch) (side-by-side diff) | |
tree | 5ff73aaf1ac1c59cde2e9ddafe8cebcddb162158 | |
parent | d3451a94e3a4425f9f1b1dcc3999259270780631 (diff) | |
download | opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.zip opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.tar.gz opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.tar.bz2 |
- getting rid of the buttonPixUp/Down arrays, reuse the Button structure
instead
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
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 } - for ( int i = 0; i < 7; i++ ) { - buttonPixUp[i] = NULL; - buttonPixDown[i] = NULL; - } - setBackgroundPixmap( pixBg ); @@ -141,9 +136,6 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye -VideoWidget::~VideoWidget() { - for ( int i = 0; i < 7; i++ ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; - } +VideoWidget::~VideoWidget() +{ } @@ -156,7 +148,7 @@ QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { } -QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { - QPixmap *pixmap = new QPixmap( pix ); - pixmap->setMask( mask ); +QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) { + QPixmap pixmap( pix ); + pixmap.setMask( mask ); return pixmap; } @@ -188,8 +180,6 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { if ( !button.mask.isNull() ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; - buttonPixUp[i] = maskVPixToMask( *pixUp, button.mask ); - buttonPixDown[i] = maskVPixToMask( *pixDn, button.mask ); + button.pixUp = maskVPixToMask( *pixUp, button.mask ); + button.pixDown = maskVPixToMask( *pixDn, button.mask ); } } @@ -261,8 +251,10 @@ void VideoWidget::setToggleButton( int i, bool down ) { void VideoWidget::paintButton( QPainter &p, int i ) { - if ( buttons[i].isDown ) { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + Button &button = buttons[ i ]; + + if ( button.isDown ) { + p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); } else { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); } } 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: QImage imgUp; QImage imgDn; - QPixmap *buttonPixUp[7]; - QPixmap *buttonPixDown[7]; QString skin; |