author | harlekin <harlekin> | 2002-08-15 20:57:59 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-15 20:57:59 (UTC) |
commit | 8b6d28983e62dd26acfeb9cf7408e21f68558a16 (patch) (unidiff) | |
tree | 14e39d98af67d3716bb643dd44dca440fa830459 | |
parent | be99f951c39d19a6e9923103434afdb293741d35 (diff) | |
download | opie-8b6d28983e62dd26acfeb9cf7408e21f68558a16.zip opie-8b6d28983e62dd26acfeb9cf7408e21f68558a16.tar.gz opie-8b6d28983e62dd26acfeb9cf7408e21f68558a16.tar.bz2 |
kill artefacts when getting back to videowidget
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index c2080e6..0521419 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -120,49 +120,48 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
120 | for ( int i = 0; i < 7; i++ ) { | 120 | for ( int i = 0; i < 7; i++ ) { |
121 | buttonPixUp[i] = NULL; | 121 | buttonPixUp[i] = NULL; |
122 | buttonPixDown[i] = NULL; | 122 | buttonPixDown[i] = NULL; |
123 | } | 123 | } |
124 | 124 | ||
125 | setBackgroundPixmap( *pixBg ); | 125 | setBackgroundPixmap( *pixBg ); |
126 | 126 | ||
127 | slider = new QSlider( Qt::Horizontal, this ); | 127 | slider = new QSlider( Qt::Horizontal, this ); |
128 | slider->setMinValue( 0 ); | 128 | slider->setMinValue( 0 ); |
129 | slider->setMaxValue( 1 ); | 129 | slider->setMaxValue( 1 ); |
130 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 130 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
131 | slider->setFocusPolicy( QWidget::NoFocus ); | 131 | slider->setFocusPolicy( QWidget::NoFocus ); |
132 | 132 | ||
133 | resizeEvent( NULL ); | 133 | resizeEvent( NULL ); |
134 | 134 | ||
135 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 135 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
136 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 136 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
137 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 137 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
138 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 138 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
139 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 139 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
140 | 140 | ||
141 | setLength( mediaPlayerState->length() ); | 141 | setLength( mediaPlayerState->length() ); |
142 | setPosition( mediaPlayerState->position() ); | 142 | setPosition( mediaPlayerState->position() ); |
143 | setFullscreen( mediaPlayerState->fullscreen() ); | 143 | setFullscreen( mediaPlayerState->fullscreen() ); |
144 | // setPaused( mediaPlayerState->paused() ); | ||
145 | setPlaying( mediaPlayerState->playing() ); | 144 | setPlaying( mediaPlayerState->playing() ); |
146 | } | 145 | } |
147 | 146 | ||
148 | 147 | ||
149 | VideoWidget::~VideoWidget() { | 148 | VideoWidget::~VideoWidget() { |
150 | 149 | ||
151 | for ( int i = 0; i < 7; i++ ) { | 150 | for ( int i = 0; i < 7; i++ ) { |
152 | delete buttonPixUp[i]; | 151 | delete buttonPixUp[i]; |
153 | delete buttonPixDown[i]; | 152 | delete buttonPixDown[i]; |
154 | } | 153 | } |
155 | 154 | ||
156 | delete pixBg; | 155 | delete pixBg; |
157 | delete imgUp; | 156 | delete imgUp; |
158 | delete imgDn; | 157 | delete imgDn; |
159 | delete imgButtonMask; | 158 | delete imgButtonMask; |
160 | for ( int i = 0; i < 7; i++ ) { | 159 | for ( int i = 0; i < 7; i++ ) { |
161 | delete masks[i]; | 160 | delete masks[i]; |
162 | } | 161 | } |
163 | 162 | ||
164 | } | 163 | } |
165 | 164 | ||
166 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 165 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
167 | QPixmap pix( img.width(), img.height() ); | 166 | QPixmap pix( img.width(), img.height() ); |
168 | QPainter p( &pix ); | 167 | QPainter p( &pix ); |
@@ -372,50 +371,50 @@ void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | |||
372 | } | 371 | } |
373 | mouseMoveEvent( event ); | 372 | mouseMoveEvent( event ); |
374 | } | 373 | } |
375 | 374 | ||
376 | void VideoWidget::showEvent( QShowEvent* ) { | 375 | void VideoWidget::showEvent( QShowEvent* ) { |
377 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 376 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
378 | mouseMoveEvent( &event ); | 377 | mouseMoveEvent( &event ); |
379 | } | 378 | } |
380 | 379 | ||
381 | 380 | ||
382 | void VideoWidget::backToNormal() { | 381 | void VideoWidget::backToNormal() { |
383 | mediaPlayerState->setFullscreen( FALSE ); | 382 | mediaPlayerState->setFullscreen( FALSE ); |
384 | makeVisible(); | 383 | makeVisible(); |
385 | } | 384 | } |
386 | 385 | ||
387 | void VideoWidget::makeVisible() { | 386 | void VideoWidget::makeVisible() { |
388 | if ( mediaPlayerState->fullscreen() ) { | 387 | if ( mediaPlayerState->fullscreen() ) { |
389 | setBackgroundMode( QWidget::NoBackground ); | 388 | setBackgroundMode( QWidget::NoBackground ); |
390 | showFullScreen(); | 389 | showFullScreen(); |
391 | resize( qApp->desktop()->size() ); | 390 | resize( qApp->desktop()->size() ); |
392 | slider->hide(); | 391 | slider->hide(); |
393 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 392 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
394 | 393 | ||
395 | } else { | 394 | } else { |
396 | showNormal(); | ||
397 | showMaximized(); | 395 | showMaximized(); |
396 | setBackgroundPixmap( *pixBg ); | ||
398 | slider->show(); | 397 | slider->show(); |
399 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 398 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
400 | qApp->processEvents(); | 399 | qApp->processEvents(); |
401 | } | 400 | } |
402 | } | 401 | } |
403 | 402 | ||
404 | 403 | ||
405 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 404 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
406 | QPainter p( this ); | 405 | QPainter p( this ); |
407 | 406 | ||
408 | if ( mediaPlayerState->fullscreen() ) { | 407 | if ( mediaPlayerState->fullscreen() ) { |
409 | // Clear the background | 408 | // Clear the background |
410 | p.setBrush( QBrush( Qt::black ) ); | 409 | p.setBrush( QBrush( Qt::black ) ); |
411 | } else { | 410 | } else { |
412 | if ( !pe->erased() ) { | 411 | if ( !pe->erased() ) { |
413 | // Combine with background and double buffer | 412 | // Combine with background and double buffer |
414 | QPixmap pix( pe->rect().size() ); | 413 | QPixmap pix( pe->rect().size() ); |
415 | QPainter p( &pix ); | 414 | QPainter p( &pix ); |
416 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 415 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
417 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 416 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
418 | for ( int i = 0; i < numVButtons; i++ ) { | 417 | for ( int i = 0; i < numVButtons; i++ ) { |
419 | paintButton( &p, i ); | 418 | paintButton( &p, i ); |
420 | } | 419 | } |
421 | QPainter p2( this ); | 420 | QPainter p2( this ); |