summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index cead612..7b29ce7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -386,65 +386,68 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
386#ifndef DESKTOP_VERSION 386#ifndef DESKTOP_VERSION
387 align = ( AlignLeft|WordBreak|AlignTop); 387 align = ( AlignLeft|WordBreak|AlignTop);
388#else 388#else
389 align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 389 align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
390#endif 390#endif
391 if ( addIcon ) { 391 if ( addIcon ) {
392 if ( ! horLayout ) { 392 if ( ! horLayout ) {
393 x += AGENDA_ICON_SIZE+3; 393 x += AGENDA_ICON_SIZE+3;
394 w -= (AGENDA_ICON_SIZE+3); 394 w -= (AGENDA_ICON_SIZE+3);
395 } 395 }
396 else { 396 else {
397 yy+= AGENDA_ICON_SIZE+2; 397 yy+= AGENDA_ICON_SIZE+2;
398 h -=(AGENDA_ICON_SIZE+3); 398 h -=(AGENDA_ICON_SIZE+3);
399 } 399 }
400 } 400 }
401 int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); 401 int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue();
402 if ( colsum < 250 ) 402 if ( colsum < 250 )
403 paint->setPen ( white); 403 paint->setPen ( white);
404 if ( x < 0 ) { 404 if ( x < 0 ) {
405 w = w+x-3; 405 w = w+x-3;
406 x = 3; 406 x = 3;
407 if ( w > parentWidget()->width() ){ 407 if ( w > parentWidget()->width() ){
408 w = parentWidget()->width() - 6; 408 w = parentWidget()->width() - 6;
409#ifndef DESKTOP_VERSION 409#ifndef DESKTOP_VERSION
410 align = ( AlignCenter|WordBreak); 410 align = ( AlignCenter|WordBreak);
411#else 411#else
412 align = ( AlignCenter|BreakAnywhere|WordBreak); 412 align = ( AlignCenter|BreakAnywhere|WordBreak);
413#endif 413#endif
414 414
415 } 415 }
416 } 416 }
417 QRect dr; 417 QRect dr;
418 if ( w + x > parentWidget()->width() )
419 w = parentWidget()->width()-x;
418 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); 420 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
421 //qDebug("%d %d %d %d ", x, yy, w, h );
419 if ( mIncidence->cancelled() ){ 422 if ( mIncidence->cancelled() ){
420 if ( ! small ) { 423 if ( ! small ) {
421 QFontMetrics fm ( paint->font() ); 424 QFontMetrics fm ( paint->font() );
422 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); 425 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
423 } 426 }
424 427
425 } 428 }
426 pa.end(); 429 pa.end();
427 430
428} 431}
429void KOAgendaItem::resizePixmap( int w , int h ) 432void KOAgendaItem::resizePixmap( int w , int h )
430{ 433{
431 paintPix()->resize( w, h ); 434 paintPix()->resize( w, h );
432 paintPixSel()->resize( w, h ); 435 paintPixSel()->resize( w, h );
433 436
434} 437}
435QPixmap * KOAgendaItem::paintPix() 438QPixmap * KOAgendaItem::paintPix()
436{ 439{
437 static QPixmap* mPaintPix = 0; 440 static QPixmap* mPaintPix = 0;
438 if ( ! mPaintPix ) 441 if ( ! mPaintPix )
439 mPaintPix = new QPixmap(1,1); 442 mPaintPix = new QPixmap(1,1);
440 return mPaintPix ; 443 return mPaintPix ;
441} 444}
442QPixmap * KOAgendaItem::paintPixAllday() 445QPixmap * KOAgendaItem::paintPixAllday()
443{ 446{
444 static QPixmap* mPaintPixA = 0; 447 static QPixmap* mPaintPixA = 0;
445 if ( ! mPaintPixA ) 448 if ( ! mPaintPixA )
446 mPaintPixA = new QPixmap(1,1); 449 mPaintPixA = new QPixmap(1,1);
447 return mPaintPixA ; 450 return mPaintPixA ;
448} 451}
449QPixmap * KOAgendaItem::paintPixSel() 452QPixmap * KOAgendaItem::paintPixSel()
450{ 453{