author | llornkcor <llornkcor> | 2002-07-29 23:45:41 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-29 23:45:41 (UTC) |
commit | 0adb56cb2cd83e9933baa9776c77c4c637f93d04 (patch) (unidiff) | |
tree | 13cba758a845d0a7ec079924c8fd71fb1fa416dc | |
parent | 121002ebe4cdebd99fcba5ec833c1c7b05bb8892 (diff) | |
download | opie-0adb56cb2cd83e9933baa9776c77c4c637f93d04.zip opie-0adb56cb2cd83e9933baa9776c77c4c637f93d04.tar.gz opie-0adb56cb2cd83e9933baa9776c77c4c637f93d04.tar.bz2 |
paintevent
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 1fae689..689366e 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -368,97 +368,97 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
368 | } | 368 | } |
369 | } else if ( !isOnButton && audioButtons[i].isHeld ) { | 369 | } else if ( !isOnButton && audioButtons[i].isHeld ) { |
370 | audioButtons[i].isHeld = FALSE; | 370 | audioButtons[i].isHeld = FALSE; |
371 | toggleButton(i); | 371 | toggleButton(i); |
372 | } | 372 | } |
373 | } else { | 373 | } else { |
374 | if ( audioButtons[i].isHeld ) { | 374 | if ( audioButtons[i].isHeld ) { |
375 | audioButtons[i].isHeld = FALSE; | 375 | audioButtons[i].isHeld = FALSE; |
376 | if ( !audioButtons[i].isToggle ) | 376 | if ( !audioButtons[i].isToggle ) |
377 | setToggleButton( i, FALSE ); | 377 | setToggleButton( i, FALSE ); |
378 | switch (i) { | 378 | switch (i) { |
379 | case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; | 379 | case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; |
380 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; | 380 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; |
381 | case AudioPause: mediaPlayerState->setPaused(audioButtons[i].isDown); return; | 381 | case AudioPause: mediaPlayerState->setPaused(audioButtons[i].isDown); return; |
382 | case AudioNext: mediaPlayerState->setNext(); return; | 382 | case AudioNext: mediaPlayerState->setNext(); return; |
383 | case AudioPrevious: mediaPlayerState->setPrev(); return; | 383 | case AudioPrevious: mediaPlayerState->setPrev(); return; |
384 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; | 384 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; |
385 | case AudioVolumeUp: emit moreReleased(); return; | 385 | case AudioVolumeUp: emit moreReleased(); return; |
386 | case AudioVolumeDown: emit lessReleased(); return; | 386 | case AudioVolumeDown: emit lessReleased(); return; |
387 | case AudioPlayList: mediaPlayerState->setList(); return; | 387 | case AudioPlayList: mediaPlayerState->setList(); return; |
388 | } | 388 | } |
389 | } | 389 | } |
390 | } | 390 | } |
391 | } | 391 | } |
392 | } | 392 | } |
393 | 393 | ||
394 | 394 | ||
395 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 395 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
396 | mouseMoveEvent( event ); | 396 | mouseMoveEvent( event ); |
397 | } | 397 | } |
398 | 398 | ||
399 | 399 | ||
400 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | 400 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { |
401 | mouseMoveEvent( event ); | 401 | mouseMoveEvent( event ); |
402 | } | 402 | } |
403 | 403 | ||
404 | 404 | ||
405 | void AudioWidget::showEvent( QShowEvent* ) { | 405 | void AudioWidget::showEvent( QShowEvent* ) { |
406 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 406 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
407 | mouseMoveEvent( &event ); | 407 | mouseMoveEvent( &event ); |
408 | } | 408 | } |
409 | 409 | ||
410 | 410 | ||
411 | void AudioWidget::closeEvent( QCloseEvent* ) { | 411 | void AudioWidget::closeEvent( QCloseEvent* ) { |
412 | mediaPlayerState->setList(); | 412 | mediaPlayerState->setList(); |
413 | } | 413 | } |
414 | 414 | ||
415 | 415 | ||
416 | void AudioWidget::paintEvent( QPaintEvent * ) { | 416 | void AudioWidget::paintEvent( QPaintEvent * pe) { |
417 | if ( !pe->erased() ) { | 417 | if ( !pe->erased() ) { |
418 | // Combine with background and double buffer | 418 | // Combine with background and double buffer |
419 | QPixmap pix( pe->rect().size() ); | 419 | QPixmap pix( pe->rect().size() ); |
420 | QPainter p( &pix ); | 420 | QPainter p( &pix ); |
421 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 421 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
422 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 422 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
423 | for ( int i = 0; i < numButtons; i++ ) | 423 | for ( int i = 0; i < numButtons; i++ ) |
424 | paintButton( &p, i ); | 424 | paintButton( &p, i ); |
425 | QPainter p2( this ); | 425 | QPainter p2( this ); |
426 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 426 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
427 | } else { | 427 | } else { |
428 | QPainter p( this ); | 428 | QPainter p( this ); |
429 | for ( int i = 0; i < numButtons; i++ ) | 429 | for ( int i = 0; i < numButtons; i++ ) |
430 | paintButton( &p, i ); | 430 | paintButton( &p, i ); |
431 | } | 431 | } |
432 | } | 432 | } |
433 | 433 | ||
434 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) | 434 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) |
435 | { | 435 | { |
436 | switch ( e->key() ) { | 436 | switch ( e->key() ) { |
437 | ////////////////////////////// Zaurus keys | 437 | ////////////////////////////// Zaurus keys |
438 | case Key_Home: | 438 | case Key_Home: |
439 | break; | 439 | break; |
440 | case Key_F9: //activity | 440 | case Key_F9: //activity |
441 | hide(); | 441 | hide(); |
442 | // qDebug("Audio F9"); | 442 | // qDebug("Audio F9"); |
443 | break; | 443 | break; |
444 | case Key_F10: //contacts | 444 | case Key_F10: //contacts |
445 | break; | 445 | break; |
446 | case Key_F11: //menu | 446 | case Key_F11: //menu |
447 | break; | 447 | break; |
448 | case Key_F12: //home | 448 | case Key_F12: //home |
449 | break; | 449 | break; |
450 | case Key_F13: //mail | 450 | case Key_F13: //mail |
451 | break; | 451 | break; |
452 | case Key_Space: { | 452 | case Key_Space: { |
453 | if(mediaPlayerState->playing()) { | 453 | if(mediaPlayerState->playing()) { |
454 | // toggleButton(1); | 454 | // toggleButton(1); |
455 | mediaPlayerState->setPlaying(FALSE); | 455 | mediaPlayerState->setPlaying(FALSE); |
456 | // toggleButton(1); | 456 | // toggleButton(1); |
457 | } else { | 457 | } else { |
458 | // toggleButton(0); | 458 | // toggleButton(0); |
459 | mediaPlayerState->setPlaying(TRUE); | 459 | mediaPlayerState->setPlaying(TRUE); |
460 | // toggleButton(0); | 460 | // toggleButton(0); |
461 | } | 461 | } |
462 | } | 462 | } |
463 | break; | 463 | break; |
464 | case Key_Down: | 464 | case Key_Down: |