author | zautrix <zautrix> | 2005-04-04 18:43:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-04 18:43:08 (UTC) |
commit | 8e7f4812c4ad239b6a17cce8aa84c00274ced4df (patch) (unidiff) | |
tree | 4245f8dbe39ce59c1199a9a97dc68ec74825271b | |
parent | ff205358654ed8741f0008eabd64a0e8b0476b61 (diff) | |
download | kdepimpi-8e7f4812c4ad239b6a17cce8aa84c00274ced4df.zip kdepimpi-8e7f4812c4ad239b6a17cce8aa84c00274ced4df.tar.gz kdepimpi-8e7f4812c4ad239b6a17cce8aa84c00274ced4df.tar.bz2 |
fix
-rw-r--r-- | korganizer/koagendaitem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index b30ad75..23afe7a 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -360,128 +360,132 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | |||
360 | int yyy = yy+3; | 360 | int yyy = yy+3; |
361 | if ( tempTodo->isCompleted() ) | 361 | if ( tempTodo->isCompleted() ) |
362 | paint->drawPixmap ( xx, yyy, completedPxmp ); | 362 | paint->drawPixmap ( xx, yyy, completedPxmp ); |
363 | else { | 363 | else { |
364 | paint->drawPixmap ( xx, yyy, overduePxmp ); | 364 | paint->drawPixmap ( xx, yyy, overduePxmp ); |
365 | 365 | ||
366 | } | 366 | } |
367 | } | 367 | } |
368 | bool addIcon = false; | 368 | bool addIcon = false; |
369 | if ( ! small || w > 3 * h || h > 3* w ) | 369 | if ( ! small || w > 3 * h || h > 3* w ) |
370 | addIcon = updateIcons( paint, horLayout ); | 370 | addIcon = updateIcons( paint, horLayout ); |
371 | 371 | ||
372 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); | 372 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); |
373 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); | 373 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); |
374 | if ( ! small ) { | 374 | if ( ! small ) { |
375 | x += 3; yy += 3;w -= 6; h-= 5; | 375 | x += 3; yy += 3;w -= 6; h-= 5; |
376 | } else { | 376 | } else { |
377 | x += 2; yy += 1;w -= 4; h-= 4; | 377 | x += 2; yy += 1;w -= 4; h-= 4; |
378 | if ( nfh < 6.01 ) { | 378 | if ( nfh < 6.01 ) { |
379 | yy -= 2; | 379 | yy -= 2; |
380 | h += 4; | 380 | h += 4; |
381 | } | 381 | } |
382 | else | 382 | else |
383 | if ( nfh < h -2 ) | 383 | if ( nfh < h -2 ) |
384 | ++yy; | 384 | ++yy; |
385 | } | 385 | } |
386 | int align; | 386 | int align; |
387 | #ifndef DESKTOP_VERSION | 387 | #ifndef DESKTOP_VERSION |
388 | align = ( AlignLeft|WordBreak|AlignTop); | 388 | align = ( AlignLeft|WordBreak|AlignTop); |
389 | #else | 389 | #else |
390 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 390 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
391 | #endif | 391 | #endif |
392 | if ( addIcon ) { | 392 | if ( addIcon ) { |
393 | if ( ! horLayout ) { | 393 | if ( ! horLayout ) { |
394 | x += AGENDA_ICON_SIZE+3; | 394 | x += AGENDA_ICON_SIZE+3; |
395 | w -= (AGENDA_ICON_SIZE+3); | 395 | w -= (AGENDA_ICON_SIZE+3); |
396 | } | 396 | } |
397 | else { | 397 | else { |
398 | yy+= AGENDA_ICON_SIZE+2; | 398 | yy+= AGENDA_ICON_SIZE+2; |
399 | h -=(AGENDA_ICON_SIZE+3); | 399 | h -=(AGENDA_ICON_SIZE+3); |
400 | } | 400 | } |
401 | } | 401 | } |
402 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); | 402 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); |
403 | if ( colsum < 250 ) | 403 | if ( colsum < 250 ) |
404 | paint->setPen ( white); | 404 | paint->setPen ( white); |
405 | if ( x < 0 ) { | 405 | if ( x < 0 ) { |
406 | w = w+x-3; | 406 | w = w+x-3; |
407 | x = 3; | 407 | x = 3; |
408 | if ( w > parentWidget()->width() ){ | 408 | if ( w > parentWidget()->width() ){ |
409 | w = parentWidget()->width() - 6; | 409 | w = parentWidget()->width() - 6; |
410 | #ifndef DESKTOP_VERSION | 410 | #ifndef DESKTOP_VERSION |
411 | align = ( AlignHCenter|WordBreak|AlignTop); | 411 | align = ( AlignHCenter|WordBreak|AlignTop); |
412 | #else | 412 | #else |
413 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); | 413 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); |
414 | #endif | 414 | #endif |
415 | 415 | ||
416 | } | 416 | } |
417 | } | 417 | } |
418 | QRect dr; | 418 | QRect dr; |
419 | if ( w + x > parentWidget()->width() ) | 419 | if ( w + x > parentWidget()->width() ) |
420 | w = parentWidget()->width()-x; | 420 | w = parentWidget()->width()-x; |
421 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); | 421 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); |
422 | //qDebug("%d %d %d %d ", x, yy, w, h ); | 422 | //qDebug("%d %d %d %d ", x, yy, w, h ); |
423 | if ( mIncidence->cancelled() ){ | 423 | if ( mIncidence->cancelled() ){ |
424 | |||
425 | |||
426 | small = ( height() < 20 ); | ||
427 | |||
424 | if ( ! small ) { | 428 | if ( ! small ) { |
425 | QFontMetrics fm ( paint->font() ); | 429 | QFontMetrics fm ( paint->font() ); |
426 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); | 430 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); |
427 | } | 431 | } |
428 | 432 | ||
429 | } | 433 | } |
430 | pa.end(); | 434 | pa.end(); |
431 | 435 | ||
432 | } | 436 | } |
433 | void KOAgendaItem::resizePixmap( int w , int h ) | 437 | void KOAgendaItem::resizePixmap( int w , int h ) |
434 | { | 438 | { |
435 | paintPix()->resize( w, h ); | 439 | paintPix()->resize( w, h ); |
436 | paintPixSel()->resize( w, h ); | 440 | paintPixSel()->resize( w, h ); |
437 | 441 | ||
438 | } | 442 | } |
439 | QPixmap * KOAgendaItem::paintPix() | 443 | QPixmap * KOAgendaItem::paintPix() |
440 | { | 444 | { |
441 | static QPixmap* mPaintPix = 0; | 445 | static QPixmap* mPaintPix = 0; |
442 | if ( ! mPaintPix ) | 446 | if ( ! mPaintPix ) |
443 | mPaintPix = new QPixmap(1,1); | 447 | mPaintPix = new QPixmap(1,1); |
444 | return mPaintPix ; | 448 | return mPaintPix ; |
445 | } | 449 | } |
446 | QPixmap * KOAgendaItem::paintPixAllday() | 450 | QPixmap * KOAgendaItem::paintPixAllday() |
447 | { | 451 | { |
448 | static QPixmap* mPaintPixA = 0; | 452 | static QPixmap* mPaintPixA = 0; |
449 | if ( ! mPaintPixA ) | 453 | if ( ! mPaintPixA ) |
450 | mPaintPixA = new QPixmap(1,1); | 454 | mPaintPixA = new QPixmap(1,1); |
451 | return mPaintPixA ; | 455 | return mPaintPixA ; |
452 | } | 456 | } |
453 | QPixmap * KOAgendaItem::paintPixSel() | 457 | QPixmap * KOAgendaItem::paintPixSel() |
454 | { | 458 | { |
455 | static QPixmap* mPaintPixSel = 0; | 459 | static QPixmap* mPaintPixSel = 0; |
456 | if ( ! mPaintPixSel ) | 460 | if ( ! mPaintPixSel ) |
457 | mPaintPixSel = new QPixmap(1,1); | 461 | mPaintPixSel = new QPixmap(1,1); |
458 | return mPaintPixSel ; | 462 | return mPaintPixSel ; |
459 | } | 463 | } |
460 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) | 464 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) |
461 | { | 465 | { |
462 | 466 | ||
463 | if ( globalFlagBlockAgendaItemPaint ) | 467 | if ( globalFlagBlockAgendaItemPaint ) |
464 | return; | 468 | return; |
465 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) | 469 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) |
466 | return; | 470 | return; |
467 | int yy; | 471 | int yy; |
468 | if ( mAllDay ) | 472 | if ( mAllDay ) |
469 | yy = y(); | 473 | yy = y(); |
470 | else | 474 | else |
471 | yy = mCellYTop * ( height() / cellHeight() ); | 475 | yy = mCellYTop * ( height() / cellHeight() ); |
472 | int xx = x(); | 476 | int xx = x(); |
473 | 477 | ||
474 | if ( xPaintCoord != xx || yPaintCoord != yy || | 478 | if ( xPaintCoord != xx || yPaintCoord != yy || |
475 | wPaintCoord != width() || hPaintCoord != height()) { | 479 | wPaintCoord != width() || hPaintCoord != height()) { |
476 | xPaintCoord= xx; | 480 | xPaintCoord= xx; |
477 | yPaintCoord = yy; | 481 | yPaintCoord = yy; |
478 | wPaintCoord = width(); | 482 | wPaintCoord = width(); |
479 | hPaintCoord = height(); | 483 | hPaintCoord = height(); |
480 | globalFlagBlockAgendaItemUpdate = 0; | 484 | globalFlagBlockAgendaItemUpdate = 0; |
481 | paintMe( mSelected ); | 485 | paintMe( mSelected ); |
482 | //qDebug("calling paintMe "); | 486 | //qDebug("calling paintMe "); |
483 | globalFlagBlockAgendaItemUpdate = 1; | 487 | globalFlagBlockAgendaItemUpdate = 1; |
484 | } | 488 | } |
485 | int rx, ry, rw, rh; | 489 | int rx, ry, rw, rh; |
486 | rx = e->rect().x(); | 490 | rx = e->rect().x(); |
487 | ry = e->rect().y(); | 491 | ry = e->rect().y(); |