summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 15:10:48 (UTC)
committer simon <simon>2002-12-09 15:10:48 (UTC)
commit80902b6ade54252e05cf948040a11b2e975f6759 (patch) (side-by-side diff)
treed251490e8e1e83af1cd8522736cc02a772463f0f
parente487238141c57df63252e41a47b409cbb1f9ae83 (diff)
downloadopie-80902b6ade54252e05cf948040a11b2e975f6759.zip
opie-80902b6ade54252e05cf948040a11b2e975f6759.tar.gz
opie-80902b6ade54252e05cf948040a11b2e975f6759.tar.bz2
- paintButton is no more a duplicated method but centralized in the
base class now :)
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
@@ -315,11 +315,2 @@ void AudioWidget::setToggleButton( int i, bool down ) {
-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() {
@@ -417,3 +408,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
for ( unsigned int i = 0; i < buttons.count(); i++ )
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
QPainter p2( this );
@@ -423,3 +414,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
for ( unsigned int i = 0; i < buttons.count(); i++ )
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
}
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
@@ -94,3 +94,2 @@ private:
void setToggleButton( int, bool );
- virtual void paintButton( QPainter &p, int i );
int skipDirection;
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
@@ -73,3 +73,11 @@ 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 );
}
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
@@ -88,3 +88,3 @@ protected:
void paintButton( int buttonId );
- virtual void paintButton( QPainter &p, int i ) = 0;
+ void paintButton( QPainter &p, const Button &button );
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
@@ -250,13 +250,2 @@ void VideoWidget::setToggleButton( int i, bool down ) {
-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 ) {
@@ -405,3 +394,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
}
@@ -412,3 +401,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
for ( unsigned int i = 0; i < buttons.count(); i++ )
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
}
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
@@ -105,3 +105,2 @@ private:
- virtual void paintButton( QPainter &p, int i );
void setToggleButton( int, bool );