From a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 14 Dec 2002 17:30:26 +0000 Subject: - kill the flickery when painting. backgroundmode is now always NoBackground and we do full double-buffering in the paintEvent --- (limited to 'noncore/multimedia/opieplayer2') diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index cd5bea4..5d929cb 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -171,8 +171,6 @@ void AudioWidget::loadSkin() { loadDefaultSkin( guiInfo() ); - setBackgroundPixmap( backgroundPixmap ); - songInfo.setFocusPolicy( QWidget::NoFocus ); // changeTextColor( &songInfo ); // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 702e6d7..f7a22a3 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -33,6 +33,8 @@ MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPla this, SLOT( setLength( long ) ) ); connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); + + setBackgroundMode( NoBackground ); } MediaWidget::~MediaWidget() @@ -91,21 +93,13 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) // Clear the background p.setBrush( QBrush( Qt::black ) ); return; - } - - if ( !pe->erased() ) { - // Combine with background and double buffer - QPixmap pix( pe->rect().size() ); - QPainter p( &pix ); - p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); - p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() ); - paintAllButtons( p ); - QPainter p2( this ); - p2.drawPixmap( pe->rect().topLeft(), pix ); - } else { - QPainter p( this ); - paintAllButtons( p ); } + + QPixmap buffer( size() ); + QPainter bufferedPainter( &buffer ); + bufferedPainter.drawTiledPixmap( rect(), backgroundPixmap, QPoint( 0, 0 ) ); + paintAllButtons( bufferedPainter ); + p.drawPixmap( 0, 0, buffer ); } void MediaWidget::resizeEvent( QResizeEvent *e ) diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 2300630..755cd22 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -164,8 +164,6 @@ void VideoWidget::loadSkin() { loadDefaultSkin( guiInfo() ); - setBackgroundPixmap( backgroundPixmap ); - delete slider; slider = new QSlider( Qt::Horizontal, this ); slider->setMinValue( 0 ); @@ -209,7 +207,6 @@ void VideoWidget::backToNormal() { void VideoWidget::makeVisible() { if ( mediaPlayerState.isFullscreen() ) { - setBackgroundMode( QWidget::NoBackground ); showFullScreen(); resize( qApp->desktop()->size() ); videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); @@ -223,7 +220,6 @@ void VideoWidget::makeVisible() { } else { showNormal(); showMaximized(); - setBackgroundPixmap( backgroundPixmap ); QWidget *d = QApplication::desktop(); int w = d->width(); int h = d->height(); -- cgit v0.9.0.2