summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp13
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp15
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
6 files changed, 14 insertions, 28 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 12f91a9..5cc2814 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -312,17 +312,8 @@ void AudioWidget::setToggleButton( int i, bool down ) {
toggleButton( i );
}
}
-void AudioWidget::paintButton( QPainter &p, int i ) {
- if ( buttons[i].isDown ) {
- p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixDown );
- } else {
- p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixUp );
- }
-}
-
-
void AudioWidget::skipFor() {
skipDirection = +1;
startTimer( 50 );
mediaPlayerState.setPosition( mediaPlayerState.position() + 2 );
@@ -414,15 +405,15 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
for ( unsigned int i = 0; i < buttons.count(); i++ )
- paintButton( p, 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, i );
+ paintButton( p, buttons[ i ] );
}
}
void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 332fb4b..7a775cd 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -91,9 +91,8 @@ private slots:
void skipBack();
void stopSkip();
private:
void setToggleButton( int, bool );
- virtual void paintButton( QPainter &p, int i );
int skipDirection;
QString skin;
QPixmap pixBg;
QImage imgUp;
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index 62266ad..f977b61 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -70,9 +70,17 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const
void MediaWidget::paintButton( int buttonId )
{
QPainter p( this );
- paintButton( p, buttonId );
+ paintButton( p, buttons[ buttonId ] );
+}
+
+void MediaWidget::paintButton( QPainter &p, const Button &button )
+{
+ if ( button.isDown )
+ p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
+ else
+ p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
}
void MediaWidget::toggleButton( int buttonId )
{
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 49bf024..163f449 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -85,9 +85,9 @@ protected:
bool isOverButton( const QPoint &position, int buttonId ) const;
void paintButton( int buttonId );
- virtual void paintButton( QPainter &p, int i ) = 0;
+ void paintButton( QPainter &p, const Button &button );
void toggleButton( int buttonId );
MediaPlayerState &mediaPlayerState;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 3baa087..a483434 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -247,19 +247,8 @@ void VideoWidget::setToggleButton( int i, bool down ) {
toggleButton( i );
}
}
-void VideoWidget::paintButton( QPainter &p, int i ) {
-
- Button &button = buttons[ i ];
-
- if ( button.isDown ) {
- p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
- } else {
- p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
- }
-}
-
void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
@@ -402,16 +391,16 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
- paintButton( p, 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, i );
+ paintButton( p, buttons[ i ] );
}
//slider->repaint( TRUE );
}
}
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index 937feac..a271120 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -102,9 +102,8 @@ private:
QImage imgDn;
QString skin;
- virtual void paintButton( QPainter &p, int i );
void setToggleButton( int, bool );
QString backgroundPix;
QSlider *slider;