summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 15:10:48 (UTC)
committer simon <simon>2002-12-09 15:10:48 (UTC)
commit80902b6ade54252e05cf948040a11b2e975f6759 (patch) (unidiff)
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
@@ -314,13 +314,4 @@ void AudioWidget::setToggleButton( int i, bool down ) {
314} 314}
315 315
316void AudioWidget::paintButton( QPainter &p, int i ) {
317 if ( buttons[i].isDown ) {
318 p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixDown );
319 } else {
320 p.drawPixmap( upperLeftOfButtonMask, buttons[i].pixUp );
321 }
322}
323
324
325void AudioWidget::skipFor() { 316void AudioWidget::skipFor() {
326 skipDirection = +1; 317 skipDirection = +1;
@@ -416,5 +407,5 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
416 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); 407 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
417 for ( unsigned int i = 0; i < buttons.count(); i++ ) 408 for ( unsigned int i = 0; i < buttons.count(); i++ )
418 paintButton( p, i ); 409 paintButton( p, buttons[ i ] );
419 QPainter p2( this ); 410 QPainter p2( this );
420 p2.drawPixmap( pe->rect().topLeft(), pix ); 411 p2.drawPixmap( pe->rect().topLeft(), pix );
@@ -422,5 +413,5 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
422 QPainter p( this ); 413 QPainter p( this );
423 for ( unsigned int i = 0; i < buttons.count(); i++ ) 414 for ( unsigned int i = 0; i < buttons.count(); i++ )
424 paintButton( p, i ); 415 paintButton( p, buttons[ i ] );
425 } 416 }
426} 417}
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
@@ -93,5 +93,4 @@ private slots:
93private: 93private:
94 void setToggleButton( int, bool ); 94 void setToggleButton( int, bool );
95 virtual void paintButton( QPainter &p, int i );
96 int skipDirection; 95 int skipDirection;
97 QString skin; 96 QString skin;
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
@@ -72,5 +72,13 @@ void MediaWidget::paintButton( int buttonId )
72{ 72{
73 QPainter p( this ); 73 QPainter p( this );
74 paintButton( p, buttonId ); 74 paintButton( p, buttons[ buttonId ] );
75}
76
77void MediaWidget::paintButton( QPainter &p, const Button &button )
78{
79 if ( button.isDown )
80 p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
81 else
82 p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
75} 83}
76 84
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
@@ -87,5 +87,5 @@ protected:
87 87
88 void paintButton( int buttonId ); 88 void paintButton( int buttonId );
89 virtual void paintButton( QPainter &p, int i ) = 0; 89 void paintButton( QPainter &p, const Button &button );
90 90
91 void toggleButton( int buttonId ); 91 void toggleButton( int buttonId );
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
@@ -249,15 +249,4 @@ void VideoWidget::setToggleButton( int i, bool down ) {
249} 249}
250 250
251void VideoWidget::paintButton( QPainter &p, int i ) {
252
253 Button &button = buttons[ i ];
254
255 if ( button.isDown ) {
256 p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
257 } else {
258 p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
259 }
260}
261
262void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { 251void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
263 for ( unsigned int i = 0; i < buttons.count(); i++ ) { 252 for ( unsigned int i = 0; i < buttons.count(); i++ ) {
@@ -404,5 +393,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
404 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); 393 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
405 for ( unsigned int i = 0; i < buttons.count(); i++ ) { 394 for ( unsigned int i = 0; i < buttons.count(); i++ ) {
406 paintButton( p, i ); 395 paintButton( p, buttons[ i ] );
407 } 396 }
408 QPainter p2( this ); 397 QPainter p2( this );
@@ -411,5 +400,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
411 QPainter p( this ); 400 QPainter p( this );
412 for ( unsigned int i = 0; i < buttons.count(); i++ ) 401 for ( unsigned int i = 0; i < buttons.count(); i++ )
413 paintButton( p, i ); 402 paintButton( p, buttons[ i ] );
414 } 403 }
415 //slider->repaint( TRUE ); 404 //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
@@ -104,5 +104,4 @@ private:
104 104
105 105
106 virtual void paintButton( QPainter &p, int i );
107 void setToggleButton( int, bool ); 106 void setToggleButton( int, bool );
108 107