author | simon <simon> | 2002-12-09 15:46:08 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 15:46:08 (UTC) |
commit | aa766a6a0818ed0b756f8cd67fc4a1c85906f224 (patch) (side-by-side diff) | |
tree | fe6af32c30e0355f839a8a574d1ec7d8a7561fd5 /noncore/multimedia/opieplayer2 | |
parent | 21738c78103c42605625f85abf7bfd0d6beaad3f (diff) | |
download | opie-aa766a6a0818ed0b756f8cd67fc4a1c85906f224.zip opie-aa766a6a0818ed0b756f8cd67fc4a1c85906f224.tar.gz opie-aa766a6a0818ed0b756f8cd67fc4a1c85906f224.tar.bz2 |
- toggleButton and setToggleButton now operate on a Button object instead
of an index
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 14 |
5 files changed, 17 insertions, 23 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 8c7e614..ef606ab 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -343,3 +343,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { buttons[i].isHeld = TRUE; - toggleButton(i); + toggleButton( buttons[ i ] ); switch (i) { @@ -360,3 +360,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { buttons[i].isHeld = FALSE; - toggleButton(i); + toggleButton( buttons[ i ] ); } @@ -366,3 +366,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { if ( buttons[i].type != ToggleButton ) { - setToggleButton( i, FALSE ); + setToggleButton( buttons[ i ], FALSE ); } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 9b276b5..092e5ce 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -61,3 +61,3 @@ public slots: void sliderReleased( ); - void setLooping( bool b) { setToggleButton( Loop, b ); } + void setLooping( bool b) { setToggleButton( buttons[ Loop ], b ); } void setPosition( long ); @@ -67,3 +67,3 @@ public: virtual void setLength( long ); - virtual void setPlaying( bool b) { setToggleButton( Play, b ); } + virtual void setPlaying( bool b) { setToggleButton( buttons[ Play ], b ); } virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 9c5291b..66129c9 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -116,16 +116,10 @@ void MediaWidget::paintButton( QPainter &p, const Button &button ) -void MediaWidget::setToggleButton( int buttonId, bool down ) +void MediaWidget::setToggleButton( Button &button, bool down ) { - qDebug("setToggleButton %d", buttonId ); - - Button &button = buttons[ buttonId ]; - if ( down != button.isDown ) - toggleButton( buttonId ); + toggleButton( button ); } -void MediaWidget::toggleButton( int buttonId ) +void MediaWidget::toggleButton( Button &button ) { - Button &button = buttons[ buttonId ]; - button.isDown = !button.isDown; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index b7860dc..05b7b71 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -93,4 +93,4 @@ protected: - void setToggleButton( int buttonId, bool down ); - void toggleButton( int buttonId ); + void setToggleButton( Button &button, bool down ); + void toggleButton( Button &button ); diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index db4a396..673c9e8 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -252,3 +252,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { buttons[i].isHeld = TRUE; - toggleButton(i); + toggleButton( buttons[ i ] ); @@ -264,3 +264,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { buttons[i].isHeld = FALSE; - toggleButton(i); + toggleButton( buttons[ i ] ); } @@ -271,3 +271,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { if ( buttons[i].type != ToggleButton ) { - setToggleButton( i, FALSE ); + setToggleButton( buttons[ i ], FALSE ); } @@ -278,3 +278,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { if( mediaPlayerState.isPaused() ) { - setToggleButton( i, FALSE ); + setToggleButton( buttons[ i ], FALSE ); mediaPlayerState.setPaused( FALSE ); @@ -282,3 +282,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } else if( !mediaPlayerState.isPaused() ) { - setToggleButton( i, TRUE ); + setToggleButton( buttons[ i ], TRUE ); mediaPlayerState.setPaused( TRUE ); @@ -425,3 +425,3 @@ XineVideoWidget* VideoWidget::vidWidget() { void VideoWidget::setFullscreen ( bool b ) { - setToggleButton( VideoFullscreen, b ); + setToggleButton( buttons[ VideoFullscreen ], b ); } @@ -430,3 +430,3 @@ void VideoWidget::setFullscreen ( bool b ) { void VideoWidget::setPlaying( bool b) { - setToggleButton( VideoPlay, b ); + setToggleButton( buttons[ VideoPlay ], b ); } |