summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/videowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp32
1 files changed, 2 insertions, 30 deletions
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()
99{ 99{
100} 100}
101 101
102QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { 102void VideoWidget::resizeEvent( QResizeEvent *e ) {
103 QPixmap pix( img.width(), img.height() );
104 QPainter p( &pix );
105 p.drawTiledPixmap( pix.rect(), bg, offset );
106 p.drawImage( 0, 0, img );
107 return new QPixmap( pix );
108}
109
110QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) {
111 QPixmap pixmap( pix );
112 pixmap.setMask( mask );
113 return pixmap;
114}
115
116void VideoWidget::resizeEvent( QResizeEvent * ) {
117 int h = height(); 103 int h = height();
118 int w = width(); 104 int w = width();
119 //int Vh = 160; 105 //int Vh = 160;
@@ -130,22 +116,8 @@ void VideoWidget::resizeEvent( QResizeEvent * ) {
130 upperLeftOfButtonMask.ry() = 0; 116 upperLeftOfButtonMask.ry() = 0;
131 else 117 else
132 upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10; 118 upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10;
133 QPoint p = upperLeftOfButtonMask;
134
135 QPixmap *pixUp = combineVImageWithBackground( buttonUpImage, backgroundPixmap, p );
136 QPixmap *pixDn = combineVImageWithBackground( buttonDownImage, backgroundPixmap, p );
137
138 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
139 Button &button = *it;
140
141 if ( !button.mask.isNull() ) {
142 button.pixUp = maskVPixToMask( *pixUp, button.mask );
143 button.pixDown = maskVPixToMask( *pixDn, button.mask );
144 }
145 }
146 119
147 delete pixUp; 120 MediaWidget::resizeEvent( e );
148 delete pixDn;
149} 121}
150 122
151void VideoWidget::sliderPressed() { 123void VideoWidget::sliderPressed() {