summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediawidget.cpp
authorsimon <simon>2002-12-09 15:19:47 (UTC)
committer simon <simon>2002-12-09 15:19:47 (UTC)
commit47d689545e68f2439cc88630ac78016712f92cc9 (patch) (side-by-side diff)
tree5d2d01f7a68c2bed804c0b6518f9a8858de27a2e /noncore/multimedia/opieplayer2/mediawidget.cpp
parent3f37a852175ace7ee69b626f48eaea19d736b6ed (diff)
downloadopie-47d689545e68f2439cc88630ac78016712f92cc9.zip
opie-47d689545e68f2439cc88630ac78016712f92cc9.tar.gz
opie-47d689545e68f2439cc88630ac78016712f92cc9.tar.bz2
- merged the duplicated (and identical) paintEvent methods into the
base class
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (ignore 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 * )
mediaPlayerState.setList();
}
+void MediaWidget::paintEvent( QPaintEvent *pe )
+{
+ QPainter p( this );
+
+ if ( mediaPlayerState.isFullscreen() ) {
+ // 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() );
+ for ( unsigned int i = 0; i < buttons.count(); i++ ) {
+ paintButton( p, buttons[ i ] );
+ }
+ QPainter p2( this );
+ p2.drawPixmap( pe->rect().topLeft(), pix );
+ } else {
+ QPainter p( this );
+ for ( unsigned int i = 0; i < buttons.count(); i++ )
+ paintButton( p, buttons[ i ] );
+ }
+}
+
void MediaWidget::handleCommand( Command command, bool buttonDown )
{
switch ( command ) {