-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 | |||
@@ -114,13 +114,13 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
114 | QImage imgMask = button.mask.convertToImage(); | 114 | QImage imgMask = button.mask.convertToImage(); |
115 | uchar **dest = buttonMask.jumpTable(); | 115 | uchar **dest = buttonMask.jumpTable(); |
116 | for ( int y = 0; y < imgUp.height(); y++ ) { | 116 | for ( int y = 0; y < imgUp.height(); y++ ) { |
117 | uchar *line = dest[y]; | 117 | uchar *line = dest[y]; |
118 | for ( int x = 0; x < imgUp.width(); x++ ) | 118 | for ( int x = 0; x < imgUp.width(); x++ ) |
119 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 119 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
120 | line[x] = i + 1; | 120 | line[x] = button.command + 1; |
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | buttons.push_back( button ); | 124 | buttons.push_back( button ); |
125 | } | 125 | } |
126 | 126 | ||
@@ -335,46 +335,48 @@ void AudioWidget::timerEvent( QTimerEvent * ) { | |||
335 | 335 | ||
336 | 336 | ||
337 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | 337 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { |
338 | for ( unsigned int i = 0; i < buttons.size(); i++ ) { | 338 | for ( unsigned int i = 0; i < buttons.size(); i++ ) { |
339 | 339 | ||
340 | Button &button = buttons[ i ]; | 340 | Button &button = buttons[ i ]; |
341 | Command command = button.command; | ||
341 | 342 | ||
342 | if ( event->state() == QMouseEvent::LeftButton ) { | 343 | if ( event->state() == QMouseEvent::LeftButton ) { |
343 | // The test to see if the mouse click is inside the button or not | 344 | // The test to see if the mouse click is inside the button or not |
344 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); | 345 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); |
345 | 346 | ||
346 | if ( isOnButton && !button.isHeld ) { | 347 | if ( isOnButton && !button.isHeld ) { |
347 | button.isHeld = TRUE; | 348 | button.isHeld = TRUE; |
348 | toggleButton( button ); | 349 | toggleButton( button ); |
349 | switch (i) { | 350 | switch ( command ) { |
350 | case VolumeUp: | 351 | case VolumeUp: |
351 | emit moreClicked(); | 352 | emit moreClicked(); |
352 | return; | 353 | return; |
353 | case VolumeDown: | 354 | case VolumeDown: |
354 | emit lessClicked(); | 355 | emit lessClicked(); |
355 | return; | 356 | return; |
356 | case Forward: | 357 | case Forward: |
357 | emit forwardClicked(); | 358 | emit forwardClicked(); |
358 | return; | 359 | return; |
359 | case Back: | 360 | case Back: |
360 | emit backClicked(); | 361 | emit backClicked(); |
361 | return; | 362 | return; |
363 | default: break; | ||
362 | } | 364 | } |
363 | } else if ( !isOnButton && button.isHeld ) { | 365 | } else if ( !isOnButton && button.isHeld ) { |
364 | button.isHeld = FALSE; | 366 | button.isHeld = FALSE; |
365 | toggleButton( button ); | 367 | toggleButton( button ); |
366 | } | 368 | } |
367 | } else { | 369 | } else { |
368 | if ( button.isHeld ) { | 370 | if ( button.isHeld ) { |
369 | button.isHeld = FALSE; | 371 | button.isHeld = FALSE; |
370 | if ( button.type != ToggleButton ) { | 372 | if ( button.type != ToggleButton ) { |
371 | setToggleButton( button, FALSE ); | 373 | setToggleButton( button, FALSE ); |
372 | } | 374 | } |
373 | qDebug("mouseEvent %d", i); | 375 | qDebug("mouseEvent %d", i); |
374 | handleCommand( static_cast<Command>( i ), button.isDown ); | 376 | handleCommand( command, button.isDown ); |
375 | } | 377 | } |
376 | } | 378 | } |
377 | } | 379 | } |
378 | } | 380 | } |
379 | 381 | ||
380 | 382 | ||