From 2b3c450378c1da0a2175c91d652ce2eae5614ff8 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 11 Dec 2002 13:46:15 +0000 Subject: - less code duplication. code from resizeEvent is now shared as well as the image composing method and the pixmap mask helper --- (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index bc47717..a8ff540 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -99,21 +99,7 @@ VideoWidget::~VideoWidget() { } -QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { - QPixmap pix( img.width(), img.height() ); - QPainter p( &pix ); - p.drawTiledPixmap( pix.rect(), bg, offset ); - p.drawImage( 0, 0, img ); - return new QPixmap( pix ); -} - -QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) { - QPixmap pixmap( pix ); - pixmap.setMask( mask ); - return pixmap; -} - -void VideoWidget::resizeEvent( QResizeEvent * ) { +void VideoWidget::resizeEvent( QResizeEvent *e ) { int h = height(); int w = width(); //int Vh = 160; @@ -130,22 +116,8 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { upperLeftOfButtonMask.ry() = 0; else upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10; - QPoint p = upperLeftOfButtonMask; - - QPixmap *pixUp = combineVImageWithBackground( buttonUpImage, backgroundPixmap, p ); - QPixmap *pixDn = combineVImageWithBackground( buttonDownImage, backgroundPixmap, p ); - - for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) { - Button &button = *it; - - if ( !button.mask.isNull() ) { - button.pixUp = maskVPixToMask( *pixUp, button.mask ); - button.pixDown = maskVPixToMask( *pixDn, button.mask ); - } - } - delete pixUp; - delete pixDn; + MediaWidget::resizeEvent( e ); } void VideoWidget::sliderPressed() { -- cgit v0.9.0.2