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) (show 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
@@ -313,15 +313,6 @@ void AudioWidget::setToggleButton( int i, bool down ) {
313 } 313 }
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;
327 startTimer( 50 ); 318 startTimer( 50 );
@@ -415,13 +406,13 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
415 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 406 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
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 );
421 } else { 412 } else {
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}
427 418
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
@@ -92,7 +92,6 @@ private slots:
92 void stopSkip(); 92 void stopSkip();
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;
98 QPixmap pixBg; 97 QPixmap pixBg;
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
@@ -71,7 +71,15 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const
71void MediaWidget::paintButton( int buttonId ) 71void 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
77void MediaWidget::toggleButton( int buttonId ) 85void 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
@@ -86,7 +86,7 @@ protected:
86 bool isOverButton( const QPoint &position, int buttonId ) const; 86 bool isOverButton( const QPoint &position, int buttonId ) const;
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 );
92 92
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
@@ -248,17 +248,6 @@ void VideoWidget::setToggleButton( int i, bool down ) {
248 } 248 }
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++ ) {
264 if ( event->state() == QMouseEvent::LeftButton ) { 253 if ( event->state() == QMouseEvent::LeftButton ) {
@@ -403,14 +392,14 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
403 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 392 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
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 );
409 p2.drawPixmap( pe->rect().topLeft(), pix ); 398 p2.drawPixmap( pe->rect().topLeft(), pix );
410 } else { 399 } else {
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 );
416 } 405 }
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
@@ -103,7 +103,6 @@ private:
103 QString skin; 103 QString skin;
104 104
105 105
106 virtual void paintButton( QPainter &p, int i );
107 void setToggleButton( int, bool ); 106 void setToggleButton( int, bool );
108 107
109 QString backgroundPix; 108 QString backgroundPix;