-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
5 files changed, 17 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index d083273..10b1e58 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -337,13 +337,13 @@ void AudioWidget::toggleButton( int i ) { buttons[i].isDown = !buttons[i].isDown; QPainter p(this); - paintButton ( &p, i ); + paintButton ( p, i ); } -void AudioWidget::paintButton( QPainter *p, int i ) { +void AudioWidget::paintButton( QPainter &p, int i ) { if ( buttons[i].isDown ) { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); } else { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); } } @@ -443,5 +443,5 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); QPainter p2( this ); p2.drawPixmap( pe->rect().topLeft(), pix ); @@ -449,5 +449,5 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); } } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index acf2dda..a1a839c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -94,5 +94,5 @@ private: void toggleButton( int ); void setToggleButton( int, bool ); - void paintButton( QPainter *p, int i ); + virtual void paintButton( QPainter &p, int i ); int skipDirection; QString skin; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 6e12a3b..066d2ac 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -68,4 +68,7 @@ protected: bool isOverButton( const QPoint &position, int buttonId ) const; + void paintButton( int buttonId ); + virtual void paintButton( QPainter &p, int i ) = 0; + MediaPlayerState &mediaPlayerState; PlayListWidget &playList; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 6451ac4..3e677c6 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -267,13 +267,13 @@ void VideoWidget::toggleButton( int i ) { buttons[i].isDown = !buttons[i].isDown; QPainter p(this); - paintButton ( &p, i ); + paintButton ( p, i ); } -void VideoWidget::paintButton( QPainter *p, int i ) { +void VideoWidget::paintButton( QPainter &p, int i ) { if ( buttons[i].isDown ) { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); } else { - p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); } } @@ -423,5 +423,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); for ( unsigned int i = 0; i < buttons.size(); i++ ) { - paintButton( &p, i ); + paintButton( p, i ); } QPainter p2( this ); @@ -430,5 +430,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { QPainter p( this ); for ( unsigned int i = 0; i < buttons.size(); i++ ) - paintButton( &p, i ); + paintButton( p, i ); } //slider->repaint( TRUE ); diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 2a9f1e0..28f720b 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -108,5 +108,5 @@ private: - void paintButton( QPainter *p, int i ); + virtual void paintButton( QPainter &p, int i ); void toggleButton( int ); void setToggleButton( int, bool ); |