summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-14 17:30:26 (UTC)
committer simon <simon>2002-12-14 17:30:26 (UTC)
commita3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476 (patch) (unidiff)
treedde78606067af08f0e3ac8f6ccabff2661b99d08
parentbbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251 (diff)
downloadopie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.zip
opie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.tar.gz
opie-a3b9d0a1e6ee4f1e74ac3335cb2ba67f6da30476.tar.bz2
- kill the flickery when painting. backgroundmode is now always
NoBackground and we do full double-buffering in the paintEvent
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp22
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp4
3 files changed, 8 insertions, 20 deletions
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
@@ -172,6 +172,4 @@ void AudioWidget::loadSkin()
172 loadDefaultSkin( guiInfo() ); 172 loadDefaultSkin( guiInfo() );
173 173
174 setBackgroundPixmap( backgroundPixmap );
175
176 songInfo.setFocusPolicy( QWidget::NoFocus ); 174 songInfo.setFocusPolicy( QWidget::NoFocus );
177// changeTextColor( &songInfo ); 175// changeTextColor( &songInfo );
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
@@ -34,4 +34,6 @@ MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPla
34 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), 34 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ),
35 this, SLOT( setPlaying( bool ) ) ); 35 this, SLOT( setPlaying( bool ) ) );
36
37 setBackgroundMode( NoBackground );
36} 38}
37 39
@@ -92,19 +94,11 @@ void MediaWidget::paintEvent( QPaintEvent *pe )
92 p.setBrush( QBrush( Qt::black ) ); 94 p.setBrush( QBrush( Qt::black ) );
93 return; 95 return;
94 }
95
96 if ( !pe->erased() ) {
97 // Combine with background and double buffer
98 QPixmap pix( pe->rect().size() );
99 QPainter p( &pix );
100 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
101 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
102 paintAllButtons( p );
103 QPainter p2( this );
104 p2.drawPixmap( pe->rect().topLeft(), pix );
105 } else {
106 QPainter p( this );
107 paintAllButtons( p );
108 } 96 }
97
98 QPixmap buffer( size() );
99 QPainter bufferedPainter( &buffer );
100 bufferedPainter.drawTiledPixmap( rect(), backgroundPixmap, QPoint( 0, 0 ) );
101 paintAllButtons( bufferedPainter );
102 p.drawPixmap( 0, 0, buffer );
109} 103}
110 104
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
@@ -165,6 +165,4 @@ void VideoWidget::loadSkin()
165 loadDefaultSkin( guiInfo() ); 165 loadDefaultSkin( guiInfo() );
166 166
167 setBackgroundPixmap( backgroundPixmap );
168
169 delete slider; 167 delete slider;
170 slider = new QSlider( Qt::Horizontal, this ); 168 slider = new QSlider( Qt::Horizontal, this );
@@ -210,5 +208,4 @@ void VideoWidget::backToNormal() {
210void VideoWidget::makeVisible() { 208void VideoWidget::makeVisible() {
211 if ( mediaPlayerState.isFullscreen() ) { 209 if ( mediaPlayerState.isFullscreen() ) {
212 setBackgroundMode( QWidget::NoBackground );
213 showFullScreen(); 210 showFullScreen();
214 resize( qApp->desktop()->size() ); 211 resize( qApp->desktop()->size() );
@@ -224,5 +221,4 @@ void VideoWidget::makeVisible() {
224 showNormal(); 221 showNormal();
225 showMaximized(); 222 showMaximized();
226 setBackgroundPixmap( backgroundPixmap );
227 QWidget *d = QApplication::desktop(); 223 QWidget *d = QApplication::desktop();
228 int w = d->width(); 224 int w = d->width();