summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 8675ff6..303a92a 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -451,108 +451,105 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
451 451
452 } 452 }
453 } 453 }
454 QRect dr; 454 QRect dr;
455 if ( w + x > parentWidget()->width() ) 455 if ( w + x > parentWidget()->width() )
456 w = parentWidget()->width()-x; 456 w = parentWidget()->width()-x;
457 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); 457 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
458 //qDebug("%d %d %d %d ", x, yy, w, h ); 458 //qDebug("%d %d %d %d ", x, yy, w, h );
459 if ( mIncidence->cancelled() ){ 459 if ( mIncidence->cancelled() ){
460 460
461 461
462 small = ( height() < 20 ); 462 small = ( height() < 20 );
463 463
464 if ( ! small ) { 464 if ( ! small ) {
465 QFontMetrics fm ( paint->font() ); 465 QFontMetrics fm ( paint->font() );
466 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); 466 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
467 } 467 }
468 468
469 } 469 }
470 pa.end(); 470 pa.end();
471 471
472} 472}
473 473
474QPixmap * KOAgendaItem::paintPix() 474QPixmap * KOAgendaItem::paintPix()
475{ 475{
476 static QPixmap* mPaintPix = 0; 476 static QPixmap* mPaintPix = 0;
477 if ( ! mPaintPix ) { 477 if ( ! mPaintPix ) {
478 int w = QApplication::desktop()->width(); 478 int w = QApplication::desktop()->width();
479 int h = QApplication::desktop()->height(); 479 int h = QApplication::desktop()->height();
480 mPaintPix = new QPixmap(w,h); 480 mPaintPix = new QPixmap(w,h);
481 } 481 }
482 return mPaintPix ; 482 return mPaintPix ;
483} 483}
484QPixmap * KOAgendaItem::paintPixAllday() 484QPixmap * KOAgendaItem::paintPixAllday()
485{ 485{
486 static QPixmap* mPaintPixA = 0; 486 static QPixmap* mPaintPixA = 0;
487 if ( ! mPaintPixA ) { 487 if ( ! mPaintPixA ) {
488 int w = QApplication::desktop()->width(); 488 int w = QApplication::desktop()->width();
489 int h = QApplication::desktop()->height()/5; 489 int h = QApplication::desktop()->height()/5;
490 mPaintPixA = new QPixmap(w,h); 490 mPaintPixA = new QPixmap(w,h);
491 } 491 }
492 return mPaintPixA ; 492 return mPaintPixA ;
493} 493}
494 494
495void KOAgendaItem::repaintItem() 495void KOAgendaItem::repaintItem()
496{ 496{
497 globalFlagBlockAgendaItemPaint = 0; 497 globalFlagBlockAgendaItemPaint = 0;
498 globalFlagBlockAgenda = 0; 498 globalFlagBlockAgenda = 0;
499 //qDebug("AAA ");
500 repaint( false ); 499 repaint( false );
501 //qDebug("BBB ");
502} 500}
503void KOAgendaItem::paintEvent ( QPaintEvent *e ) 501void KOAgendaItem::paintEvent ( QPaintEvent *e )
504{ 502{
505 qDebug("CCC "); 503
506 if ( globalFlagBlockAgendaItemPaint ) 504 if ( globalFlagBlockAgendaItemPaint )
507 return; 505 return;
508 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) 506 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
509 return; 507 return;
510 qDebug("DDD ");
511 int yy; 508 int yy;
512 if ( mAllDay ) 509 if ( mAllDay )
513 yy = y(); 510 yy = y();
514 else 511 else
515 yy = mCellYTop * ( height() / cellHeight() ); 512 yy = mCellYTop * ( height() / cellHeight() );
516 int xx = x(); 513 int xx = x();
517 514
518 if ( xPaintCoord != xx || yPaintCoord != yy || 515 if ( xPaintCoord != xx || yPaintCoord != yy ||
519 wPaintCoord != width() || hPaintCoord != height()) { 516 wPaintCoord != width() || hPaintCoord != height()) {
520 xPaintCoord= xx; 517 xPaintCoord= xx;
521 yPaintCoord = yy; 518 yPaintCoord = yy;
522 wPaintCoord = width(); 519 wPaintCoord = width();
523 hPaintCoord = height(); 520 hPaintCoord = height();
524 globalFlagBlockAgendaItemUpdate = 0; 521 globalFlagBlockAgendaItemUpdate = 0;
525 paintMe( mSelected ); 522 paintMe( mSelected );
526 //qDebug("calling paintMe "); 523 //qDebug("calling paintMe ");
527 globalFlagBlockAgendaItemUpdate = 1; 524 globalFlagBlockAgendaItemUpdate = 1;
528 if ( mSelected ) 525 if ( mSelected )
529 return; 526 return;
530 } 527 }
531 int rx, ry, rw, rh; 528 int rx, ry, rw, rh;
532 rx = e->rect().x(); 529 rx = e->rect().x();
533 ry = e->rect().y(); 530 ry = e->rect().y();
534 rw = e->rect().width(); 531 rw = e->rect().width();
535 rh = e->rect().height(); 532 rh = e->rect().height();
536 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); 533 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
537 534
538 QPixmap* paintFrom ; 535 QPixmap* paintFrom ;
539 if ( mSelected ) { 536 if ( mSelected ) {
540 paintMe( mSelected ); 537 paintMe( mSelected );
541 return; 538 return;
542 } else { 539 } else {
543 if ( mAllDay ) 540 if ( mAllDay )
544 paintFrom = paintPixAllday(); 541 paintFrom = paintPixAllday();
545 else 542 else
546 paintFrom = paintPix(); 543 paintFrom = paintPix();
547 } 544 }
548 xx += rx; 545 xx += rx;
549 546
550 if ( xx < 0 ) { 547 if ( xx < 0 ) {
551 rw = rw + xx; 548 rw = rw + xx;
552 rx -= xx; 549 rx -= xx;
553 xx = 0; 550 xx = 0;
554 if ( rw <= 1 ) { 551 if ( rw <= 1 ) {
555 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); 552 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
556 return; 553 return;
557 } 554 }
558 } 555 }