summaryrefslogtreecommitdiff
path: root/noncore/multimedia
Unidiff
Diffstat (limited to 'noncore/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp19
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp28
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp31
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
6 files changed, 30 insertions, 52 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 553c56b..277d162 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -397,25 +397,6 @@ void AudioWidget::showEvent( QShowEvent* ) {
397 mouseMoveEvent( &event ); 397 mouseMoveEvent( &event );
398} 398}
399 399
400
401void AudioWidget::paintEvent( QPaintEvent * pe ) {
402 if ( !pe->erased() ) {
403 // Combine with background and double buffer
404 QPixmap pix( pe->rect().size() );
405 QPainter p( &pix );
406 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
407 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
408 for ( unsigned int i = 0; i < buttons.count(); i++ )
409 paintButton( p, buttons[ i ] );
410 QPainter p2( this );
411 p2.drawPixmap( pe->rect().topLeft(), pix );
412 } else {
413 QPainter p( this );
414 for ( unsigned int i = 0; i < buttons.count(); i++ )
415 paintButton( p, buttons[ i ] );
416 }
417}
418
419void AudioWidget::keyReleaseEvent( QKeyEvent *e) { 400void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
420 switch ( e->key() ) { 401 switch ( e->key() ) {
421 ////////////////////////////// Zaurus keys 402 ////////////////////////////// Zaurus keys
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 69837cd..8c433ac 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -78,7 +78,6 @@ signals:
78protected: 78protected:
79 void doBlank(); 79 void doBlank();
80 void doUnblank(); 80 void doUnblank();
81 void paintEvent( QPaintEvent *pe );
82 void showEvent( QShowEvent *se ); 81 void showEvent( QShowEvent *se );
83 void resizeEvent( QResizeEvent *re ); 82 void resizeEvent( QResizeEvent *re );
84 void mouseMoveEvent( QMouseEvent *event ); 83 void mouseMoveEvent( QMouseEvent *event );
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 ) {
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 211e56c..8cdaad1 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -81,6 +81,8 @@ signals:
81protected: 81protected:
82 virtual void closeEvent( QCloseEvent * ); 82 virtual void closeEvent( QCloseEvent * );
83 83
84 virtual void paintEvent( QPaintEvent *pe );
85
84 void handleCommand( Command command, bool buttonDown ); 86 void handleCommand( Command command, bool buttonDown );
85 87
86 bool isOverButton( const QPoint &position, int buttonId ) const; 88 bool isOverButton( const QPoint &position, int buttonId ) const;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index a8bf252..8f6a8a9 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -375,37 +375,6 @@ void VideoWidget::makeVisible() {
375 } 375 }
376} 376}
377 377
378
379
380
381void VideoWidget::paintEvent( QPaintEvent * pe) {
382 QPainter p( this );
383
384 if ( mediaPlayerState.isFullscreen() ) {
385 // Clear the background
386 p.setBrush( QBrush( Qt::black ) );
387 } else {
388 if ( !pe->erased() ) {
389 // Combine with background and double buffer
390 QPixmap pix( pe->rect().size() );
391 QPainter p( &pix );
392 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
393 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
394 for ( unsigned int i = 0; i < buttons.count(); i++ ) {
395 paintButton( p, buttons[ i ] );
396 }
397 QPainter p2( this );
398 p2.drawPixmap( pe->rect().topLeft(), pix );
399 } else {
400 QPainter p( this );
401 for ( unsigned int i = 0; i < buttons.count(); i++ )
402 paintButton( p, buttons[ i ] );
403 }
404 //slider->repaint( TRUE );
405 }
406}
407
408
409void VideoWidget::keyReleaseEvent( QKeyEvent *e) { 378void VideoWidget::keyReleaseEvent( QKeyEvent *e) {
410 switch ( e->key() ) { 379 switch ( e->key() ) {
411////////////////////////////// Zaurus keys 380////////////////////////////// Zaurus keys
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index 9d5239b..45279d7 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -88,7 +88,6 @@ signals:
88protected: 88protected:
89 89
90 void resizeEvent( QResizeEvent * ); 90 void resizeEvent( QResizeEvent * );
91 void paintEvent( QPaintEvent *pe );
92 void showEvent( QShowEvent *se ); 91 void showEvent( QShowEvent *se );
93 void mouseMoveEvent( QMouseEvent *event ); 92 void mouseMoveEvent( QMouseEvent *event );
94 void mousePressEvent( QMouseEvent *event ); 93 void mousePressEvent( QMouseEvent *event );