author | simon <simon> | 2002-12-09 16:31:17 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 16:31:17 (UTC) |
commit | 8eb71085cec5e24e20b441ceae9e5e66448405b3 (patch) (side-by-side diff) | |
tree | e970320e0052c2c5986d3f53a837aec90e2f9177 | |
parent | 3b31b000db15e7618b3ef06a652bae41d87a1348 (diff) | |
download | opie-8eb71085cec5e24e20b441ceae9e5e66448405b3.zip opie-8eb71085cec5e24e20b441ceae9e5e66448405b3.tar.gz opie-8eb71085cec5e24e20b441ceae9e5e66448405b3.tar.bz2 |
- less indexing
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index c3e206c..3838e2c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -112,17 +112,17 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye if ( !button.mask.isNull() ) { QImage imgMask = button.mask.convertToImage(); uchar **dest = buttonMask.jumpTable(); for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; for ( int x = 0; x < imgUp.width(); x++ ) if ( !qRed( imgMask.pixel( x, y ) ) ) - line[x] = i + 1; + line[x] = button.command + 1; } } buttons.push_back( button ); } setBackgroundPixmap( backgroundPixmap ); @@ -333,50 +333,52 @@ void AudioWidget::timerEvent( QTimerEvent * ) { } } void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) { Button &button = buttons[ i ]; + Command command = button.command; if ( event->state() == QMouseEvent::LeftButton ) { // The test to see if the mouse click is inside the button or not - bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); + bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); if ( isOnButton && !button.isHeld ) { button.isHeld = TRUE; toggleButton( button ); - switch (i) { + switch ( command ) { case VolumeUp: emit moreClicked(); return; case VolumeDown: emit lessClicked(); return; case Forward: emit forwardClicked(); return; case Back: emit backClicked(); return; + default: break; } } else if ( !isOnButton && button.isHeld ) { button.isHeld = FALSE; toggleButton( button ); } } else { if ( button.isHeld ) { button.isHeld = FALSE; if ( button.type != ToggleButton ) { setToggleButton( button, FALSE ); } qDebug("mouseEvent %d", i); - handleCommand( static_cast<Command>( i ), button.isDown ); + handleCommand( command, button.isDown ); } } } } void AudioWidget::mousePressEvent( QMouseEvent *event ) { mouseMoveEvent( event ); |