author | zautrix <zautrix> | 2005-07-03 20:25:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-03 20:25:46 (UTC) |
commit | ad66f0fe56bb88104fb0065ccb599ab0edd35cf4 (patch) (side-by-side diff) | |
tree | 13936362717d3a3ca36404ad5b522574418d1d89 | |
parent | f9a1b1e8ac52218360731fae67993704c20f17fe (diff) | |
download | kdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.zip kdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.tar.gz kdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.tar.bz2 |
icon agenda fix
-rw-r--r-- | korganizer/koagendaitem.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index c055eb8..9fe1be4 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -185,45 +185,48 @@ void KOAgendaItem::recreateIncidence() newInc->setDtStart( QDateTime(mDate, tim) ); ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); } #endif mIncidence = mIncidence->recreateCloneException( mDate ); } bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) { int size = AGENDA_ICON_SIZE; int yOff = 0; int xOff = 0; - int x = pos().x() +3; + int x = pos().x(); + + if ( x < 0 ) x = 0; + x += 3; int y; if ( mAllDay ) y = pos().y()+3; else y = mCellYTop * ( height() / cellHeight() ) +3; if ( mIncidence->calID() > 1 ) { p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 ); if ( horLayout ){ ++xOff; ++x; } else { ++yOff; ++y; } } - if (mIncidence->cancelled()) { + if (mIncidence->cancelled() && height() < 20 ) { int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); if ( horLayout ) ++xOff; else ++yOff; } if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); if ( horLayout ) @@ -424,24 +427,26 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) w -= (AGENDA_ICON_SIZE+3); } else { yy+= AGENDA_ICON_SIZE+2; h -=(AGENDA_ICON_SIZE+3); } } if ( mWhiteText ) paint->setPen ( white); if ( x < 0 ) { w = w+x-3; x = 3; + if ( !horLayout && addIcon ) + x += AGENDA_ICON_SIZE+3; if ( w > parentWidget()->width() ){ w = parentWidget()->width() - 6; #ifndef DESKTOP_VERSION align = ( AlignHCenter|WordBreak|AlignTop); #else align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); #endif } } QRect dr; if ( w + x > parentWidget()->width() ) |