summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediawidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index f977b61..3a44185 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -44,6 +44,34 @@ void MediaWidget::closeEvent( QCloseEvent * )
44 mediaPlayerState.setList(); 44 mediaPlayerState.setList();
45} 45}
46 46
47void MediaWidget::paintEvent( QPaintEvent *pe )
48{
49 QPainter p( this );
50
51 if ( mediaPlayerState.isFullscreen() ) {
52 // Clear the background
53 p.setBrush( QBrush( Qt::black ) );
54 return;
55 }
56
57 if ( !pe->erased() ) {
58 // Combine with background and double buffer
59 QPixmap pix( pe->rect().size() );
60 QPainter p( &pix );
61 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
62 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
63 for ( unsigned int i = 0; i < buttons.count(); i++ ) {
64 paintButton( p, buttons[ i ] );
65 }
66 QPainter p2( this );
67 p2.drawPixmap( pe->rect().topLeft(), pix );
68 } else {
69 QPainter p( this );
70 for ( unsigned int i = 0; i < buttons.count(); i++ )
71 paintButton( p, buttons[ i ] );
72 }
73}
74
47void MediaWidget::handleCommand( Command command, bool buttonDown ) 75void MediaWidget::handleCommand( Command command, bool buttonDown )
48{ 76{
49 switch ( command ) { 77 switch ( command ) {