Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
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 | |||
@@ -30,12 +30,14 @@ MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPla | |||
30 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), | 30 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), |
31 | this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); | 31 | this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); |
32 | connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), | 32 | connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), |
33 | this, SLOT( setLength( long ) ) ); | 33 | this, SLOT( setLength( long ) ) ); |
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 | ||
38 | MediaWidget::~MediaWidget() | 40 | MediaWidget::~MediaWidget() |
39 | { | 41 | { |
40 | } | 42 | } |
41 | 43 | ||
@@ -90,25 +92,17 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) | |||
90 | if ( mediaPlayerState.isFullscreen() ) { | 92 | if ( mediaPlayerState.isFullscreen() ) { |
91 | // Clear the background | 93 | // Clear the background |
92 | p.setBrush( QBrush( Qt::black ) ); | 94 | p.setBrush( QBrush( Qt::black ) ); |
93 | return; | 95 | return; |
94 | } | 96 | } |
95 | 97 | ||
96 | if ( !pe->erased() ) { | 98 | QPixmap buffer( size() ); |
97 | // Combine with background and double buffer | 99 | QPainter bufferedPainter( &buffer ); |
98 | QPixmap pix( pe->rect().size() ); | 100 | bufferedPainter.drawTiledPixmap( rect(), backgroundPixmap, QPoint( 0, 0 ) ); |
99 | QPainter p( &pix ); | 101 | paintAllButtons( bufferedPainter ); |
100 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 102 | p.drawPixmap( 0, 0, buffer ); |
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 | } | ||
109 | } | 103 | } |
110 | 104 | ||
111 | void MediaWidget::resizeEvent( QResizeEvent *e ) | 105 | void MediaWidget::resizeEvent( QResizeEvent *e ) |
112 | { | 106 | { |
113 | QPixmap pixUp = combineImageWithBackground( buttonUpImage, backgroundPixmap, upperLeftOfButtonMask ); | 107 | QPixmap pixUp = combineImageWithBackground( buttonUpImage, backgroundPixmap, upperLeftOfButtonMask ); |
114 | QPixmap pixDn = combineImageWithBackground( buttonDownImage, backgroundPixmap, upperLeftOfButtonMask ); | 108 | QPixmap pixDn = combineImageWithBackground( buttonDownImage, backgroundPixmap, upperLeftOfButtonMask ); |