summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-03 20:25:46 (UTC)
committer zautrix <zautrix>2005-07-03 20:25:46 (UTC)
commitad66f0fe56bb88104fb0065ccb599ab0edd35cf4 (patch) (unidiff)
tree13936362717d3a3ca36404ad5b522574418d1d89
parentf9a1b1e8ac52218360731fae67993704c20f17fe (diff)
downloadkdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.zip
kdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.tar.gz
kdepimpi-ad66f0fe56bb88104fb0065ccb599ab0edd35cf4.tar.bz2
icon agenda fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp9
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()
185 newInc->setDtStart( QDateTime(mDate, tim) ); 185 newInc->setDtStart( QDateTime(mDate, tim) );
186 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 186 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
187 } 187 }
188#endif 188#endif
189 mIncidence = mIncidence->recreateCloneException( mDate ); 189 mIncidence = mIncidence->recreateCloneException( mDate );
190} 190}
191bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) 191bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
192{ 192{
193 int size = AGENDA_ICON_SIZE; 193 int size = AGENDA_ICON_SIZE;
194 194
195 int yOff = 0; 195 int yOff = 0;
196 int xOff = 0; 196 int xOff = 0;
197 int x = pos().x() +3; 197 int x = pos().x();
198
199 if ( x < 0 ) x = 0;
200 x += 3;
198 int y; 201 int y;
199 if ( mAllDay ) 202 if ( mAllDay )
200 y = pos().y()+3; 203 y = pos().y()+3;
201 else 204 else
202 y = mCellYTop * ( height() / cellHeight() ) +3; 205 y = mCellYTop * ( height() / cellHeight() ) +3;
203 206
204 207
205 if ( mIncidence->calID() > 1 ) { 208 if ( mIncidence->calID() > 1 ) {
206 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() ) ); 209 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() ) );
207 p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 ); 210 p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 );
208 if ( horLayout ){ 211 if ( horLayout ){
209 ++xOff; 212 ++xOff;
210 ++x; 213 ++x;
211 } 214 }
212 else { 215 else {
213 ++yOff; 216 ++yOff;
214 ++y; 217 ++y;
215 } 218 }
216 } 219 }
217 if (mIncidence->cancelled()) { 220 if (mIncidence->cancelled() && height() < 20 ) {
218 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 221 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
219 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 222 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
220 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 223 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
221 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 224 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
222 if ( horLayout ) 225 if ( horLayout )
223 ++xOff; 226 ++xOff;
224 else 227 else
225 ++yOff; 228 ++yOff;
226 } 229 }
227 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { 230 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
228 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 231 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
229 if ( horLayout ) 232 if ( horLayout )
@@ -424,24 +427,26 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
424 w -= (AGENDA_ICON_SIZE+3); 427 w -= (AGENDA_ICON_SIZE+3);
425 } 428 }
426 else { 429 else {
427 yy+= AGENDA_ICON_SIZE+2; 430 yy+= AGENDA_ICON_SIZE+2;
428 h -=(AGENDA_ICON_SIZE+3); 431 h -=(AGENDA_ICON_SIZE+3);
429 } 432 }
430 } 433 }
431 if ( mWhiteText ) 434 if ( mWhiteText )
432 paint->setPen ( white); 435 paint->setPen ( white);
433 if ( x < 0 ) { 436 if ( x < 0 ) {
434 w = w+x-3; 437 w = w+x-3;
435 x = 3; 438 x = 3;
439 if ( !horLayout && addIcon )
440 x += AGENDA_ICON_SIZE+3;
436 if ( w > parentWidget()->width() ){ 441 if ( w > parentWidget()->width() ){
437 w = parentWidget()->width() - 6; 442 w = parentWidget()->width() - 6;
438#ifndef DESKTOP_VERSION 443#ifndef DESKTOP_VERSION
439 align = ( AlignHCenter|WordBreak|AlignTop); 444 align = ( AlignHCenter|WordBreak|AlignTop);
440#else 445#else
441 align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); 446 align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop);
442#endif 447#endif
443 448
444 } 449 }
445 } 450 }
446 QRect dr; 451 QRect dr;
447 if ( w + x > parentWidget()->width() ) 452 if ( w + x > parentWidget()->width() )