author | harlekin <harlekin> | 2002-08-15 16:30:24 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-15 16:30:24 (UTC) |
commit | 747a98bb3b2a92b6f3577fa383fc44a8644a7ce2 (patch) (side-by-side diff) | |
tree | 59ec78ec83871cb52ef4b4332cd7c44fa18de737 /noncore/multimedia | |
parent | 320f73ae9a8ffc6daf009b3fefb9035506b0f684 (diff) | |
download | opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.zip opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.tar.gz opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.tar.bz2 |
update
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index a3d34f4..2cb1385 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -365,28 +365,29 @@ void AudioWidget::setToggleButton( int i, bool down ) { } } void AudioWidget::toggleButton( int i ) { audioButtons[i].isDown = !audioButtons[i].isDown; QPainter p(this); paintButton ( &p, i ); } void AudioWidget::paintButton( QPainter *p, int i ) { - if ( audioButtons[i].isDown ) + if ( audioButtons[i].isDown ) { p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); - else + } else { p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); + } } void AudioWidget::skipFor() { skipDirection = +1; startTimer( 50 ); mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); } void AudioWidget::skipBack() { skipDirection = -1; startTimer( 50 ); @@ -403,38 +404,36 @@ void AudioWidget::stopSkip() { void AudioWidget::timerEvent( QTimerEvent * ) { if ( skipDirection == +1 ) { mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); } else if ( skipDirection == -1 ) { mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); } } void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { for ( int i = 0; i < numButtons; i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { - - // The test to see if the mouse click is inside the button or not + // The test to see if the mouse click is inside the button or not int x = event->pos().x() - xoff; int y = event->pos().y() - yoff; bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() - && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); - - if ( isOnButton && i == AudioVolumeUp ) - qDebug("on up"); + && y < imgButtonMask->height() + && imgButtonMask->pixelIndex( x, y ) == i + 1 ); if ( isOnButton && !audioButtons[i].isHeld ) { audioButtons[i].isHeld = TRUE; toggleButton(i); + switch (i) { case AudioVolumeUp: qDebug("more clicked"); emit moreClicked(); return; case AudioVolumeDown: emit lessClicked(); return; case AudioForward: emit forwardClicked(); return; case AudioBack: |