summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/videowidget.cpp
authorsimon <simon>2002-12-08 22:53:07 (UTC)
committer simon <simon>2002-12-08 22:53:07 (UTC)
commitcb1b7bf6f4dd465cc4f5b268893def8b11ce0bde (patch) (unidiff)
tree9e6497f79f24c690b5fdb737be5d38a3d5efcee5 /noncore/multimedia/opieplayer2/videowidget.cpp
parent786bc677f61983414df8a4613cc525c4bcd2a054 (diff)
downloadopie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.zip
opie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.tar.gz
opie-cb1b7bf6f4dd465cc4f5b268893def8b11ce0bde.tar.bz2
- some preparations for further code cleanups for paintButton calls
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 6451ac4..3e677c6 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -257,33 +257,33 @@ void VideoWidget::updateSlider( long i, long max ) {
257 } 257 }
258} 258}
259 259
260void VideoWidget::setToggleButton( int i, bool down ) { 260void VideoWidget::setToggleButton( int i, bool down ) {
261 if ( down != buttons[i].isDown ) { 261 if ( down != buttons[i].isDown ) {
262 toggleButton( i ); 262 toggleButton( i );
263 } 263 }
264} 264}
265 265
266void VideoWidget::toggleButton( int i ) { 266void VideoWidget::toggleButton( int i ) {
267 buttons[i].isDown = !buttons[i].isDown; 267 buttons[i].isDown = !buttons[i].isDown;
268 QPainter p(this); 268 QPainter p(this);
269 paintButton ( &p, i ); 269 paintButton ( p, i );
270} 270}
271 271
272void VideoWidget::paintButton( QPainter *p, int i ) { 272void VideoWidget::paintButton( QPainter &p, int i ) {
273 273
274 if ( buttons[i].isDown ) { 274 if ( buttons[i].isDown ) {
275 p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); 275 p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] );
276 } else { 276 } else {
277 p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); 277 p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] );
278 } 278 }
279} 279}
280 280
281void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { 281void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
282 for ( unsigned int i = 0; i < buttons.size(); i++ ) { 282 for ( unsigned int i = 0; i < buttons.size(); i++ ) {
283 if ( event->state() == QMouseEvent::LeftButton ) { 283 if ( event->state() == QMouseEvent::LeftButton ) {
284 // The test to see if the mouse click is inside the button or not 284 // The test to see if the mouse click is inside the button or not
285 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); 285 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
286 286
287 if ( isOnButton && !buttons[i].isHeld ) { 287 if ( isOnButton && !buttons[i].isHeld ) {
288 buttons[i].isHeld = TRUE; 288 buttons[i].isHeld = TRUE;
289 toggleButton(i); 289 toggleButton(i);
@@ -413,32 +413,32 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
413 413
414 if ( mediaPlayerState.isFullscreen() ) { 414 if ( mediaPlayerState.isFullscreen() ) {
415 // Clear the background 415 // Clear the background
416 p.setBrush( QBrush( Qt::black ) ); 416 p.setBrush( QBrush( Qt::black ) );
417 } else { 417 } else {
418 if ( !pe->erased() ) { 418 if ( !pe->erased() ) {
419 // Combine with background and double buffer 419 // Combine with background and double buffer
420 QPixmap pix( pe->rect().size() ); 420 QPixmap pix( pe->rect().size() );
421 QPainter p( &pix ); 421 QPainter p( &pix );
422 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 422 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
423 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); 423 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
424 for ( unsigned int i = 0; i < buttons.size(); i++ ) { 424 for ( unsigned int i = 0; i < buttons.size(); i++ ) {
425 paintButton( &p, i ); 425 paintButton( p, i );
426 } 426 }
427 QPainter p2( this ); 427 QPainter p2( this );
428 p2.drawPixmap( pe->rect().topLeft(), pix ); 428 p2.drawPixmap( pe->rect().topLeft(), pix );
429 } else { 429 } else {
430 QPainter p( this ); 430 QPainter p( this );
431 for ( unsigned int i = 0; i < buttons.size(); i++ ) 431 for ( unsigned int i = 0; i < buttons.size(); i++ )
432 paintButton( &p, i ); 432 paintButton( p, i );
433 } 433 }
434 //slider->repaint( TRUE ); 434 //slider->repaint( TRUE );
435 } 435 }
436} 436}
437 437
438 438
439void VideoWidget::keyReleaseEvent( QKeyEvent *e) { 439void VideoWidget::keyReleaseEvent( QKeyEvent *e) {
440 switch ( e->key() ) { 440 switch ( e->key() ) {
441////////////////////////////// Zaurus keys 441////////////////////////////// Zaurus keys
442 case Key_Home: 442 case Key_Home:
443 break; 443 break;
444 case Key_F9: //activity 444 case Key_F9: //activity