summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 475bb4a..cba85fa 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -294,111 +294,107 @@ MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
294} 294}
295void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) 295void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s)
296{ 296{
297 setText( s ); 297 setText( s );
298 mMultiday = 0; 298 mMultiday = 0;
299 mIncidence = incidence; 299 mIncidence = incidence;
300 mDate = qd; 300 mDate = qd;
301 mRecur = false; 301 mRecur = false;
302 mAlarm = false; 302 mAlarm = false;
303 mReply = false; 303 mReply = false;
304 mInfo = false; 304 mInfo = false;
305 mdayPos = 0; 305 mdayPos = 0;
306} 306}
307 307
308void MonthViewItem::paint(QPainter *p) 308void MonthViewItem::paint(QPainter *p)
309{ 309{
310 if ( mblockRepaint ) { 310 if ( mblockRepaint ) {
311 return; 311 return;
312 } 312 }
313#if QT_VERSION >= 0x030000 313#if QT_VERSION >= 0x030000
314 bool sel = isSelected(); 314 bool sel = isSelected();
315#else 315#else
316 bool sel = selected(); 316 bool sel = selected();
317#endif 317#endif
318
319
320 int heihei = height( listBox () ); 318 int heihei = height( listBox () );
321 int x = 1; 319 int x = 1;
322 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) 320 if (KOPrefs::instance()->mMonthViewUsesCategoryColor)
323 { 321 {
324 p->setBackgroundColor( palette().color( QPalette::Normal, \ 322 p->setBackgroundColor( palette().color( QPalette::Normal, \
325 sel ? QColorGroup::Highlight : QColorGroup::Background ) ); 323 sel ? QColorGroup::Highlight : QColorGroup::Background ) );
326 p->eraseRect( 0, 0, listBox()->maxItemWidth(), heihei ); 324 p->eraseRect( 0, 0, listBox()->maxItemWidth(), heihei );
327 } 325 }
328 326
329 //int y = 3;//(height() - mRecurPixmap.height()) /2; 327 //int y = 3;//(height() - mRecurPixmap.height()) /2;
330 int size = PIXMAP_SIZE; 328 int size = PIXMAP_SIZE;
331 if ( QApplication::desktop()->width() < 300 ) 329 if ( QApplication::desktop()->width() < 300 )
332 size = 3; 330 size = 3;
333 int y = (heihei - size -1 ) /2; 331 int y = (heihei - size -1 ) /2;
334 332
335 if ( mIncidence->calID() > 1 ) { 333 if ( mIncidence->calID() > 1 ) {
336 p->fillRect ( x, y-2,size,size+4, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); 334 p->fillRect ( x, y-2,size,size+4, KOPrefs::instance()->defaultColor( mIncidence->calID() ) );
337 p->drawRect ( x, y-2,size,size+4); 335 p->drawRect ( x, y-2,size,size+4);
338 x += size + 1; 336 x += size + 1;
339 } 337 }
340
341 if ( KOPrefs::instance()->mMonthShowIcons ) { 338 if ( KOPrefs::instance()->mMonthShowIcons ) {
342 if ( mInfo ) { 339 if ( mInfo ) {
343 p->fillRect ( x, y,size,size, Qt::darkGreen ); 340 p->fillRect ( x, y,size,size, Qt::darkGreen );
344 x += size + 1; 341 x += size + 1;
345 } 342 }
346 if ( mRecur ) { 343 if ( mRecur ) {
347 p->fillRect ( x, y,size,size, Qt::blue ); 344 p->fillRect ( x, y,size,size, Qt::blue );
348 x += size + 1; 345 x += size + 1;
349 } 346 }
350 if ( mAlarm ) { 347 if ( mAlarm ) {
351 p->fillRect ( x, y,size,size, Qt::red ); 348 p->fillRect ( x, y,size,size, Qt::red );
352 x += size + 1; 349 x += size + 1;
353 } 350 }
354 if ( mReply ) { 351 if ( mReply ) {
355 p->fillRect ( x, y,size,size, Qt::yellow ); 352 p->fillRect ( x, y,size,size, Qt::yellow );
356 x += size + 1; 353 x += size + 1;
357 } 354 }
358 } 355 }
359 if ( mMultiday ) { 356 if ( mMultiday ) {
360 int yyy = y+(size/2); 357 int yyy = y+(size/2);
361 int sizeM = size+2; 358 int sizeM = size+2;
362 p->setBrush( QBrush::SolidPattern ); 359 p->setBrush( QBrush::SolidPattern );
363 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; 360 p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
364 if ( mMultiday == 2 || mMultiday == 3 ) { 361 if ( mMultiday == 2 || mMultiday == 3 ) {
365 QPointArray pa ( 3 ); 362 QPointArray pa ( 3 );
366 pa.setPoint (0, x, yyy ); 363 pa.setPoint (0, x, yyy );
367 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); 364 pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 );
368 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); 365 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
369 p->drawPolygon( pa ); 366 p->drawPolygon( pa );
370 } 367 }
371 if ( mMultiday == 2 || mMultiday == 1 ) { 368 if ( mMultiday == 2 || mMultiday == 1 ) {
372 QPointArray pa ( 3 ); 369 QPointArray pa ( 3 );
373 pa.setPoint (0, x+sizeM +sizeM/2, yyy ); 370 pa.setPoint (0, x+sizeM +sizeM/2, yyy );
374 pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); 371 pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
375 pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); 372 pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
376 p->drawPolygon( pa ); 373 p->drawPolygon( pa );
377 } 374 }
378 if ( mMultiday == 1 ) { 375 if ( mMultiday == 1 ) {
379 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 376 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
380
381 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); 377 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
382 } 378 }
383 if ( mMultiday == 3 ) { 379 if ( mMultiday == 3 ) {
384 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 380 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
385 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); 381 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
386 382
387 } 383 }
388 x += sizeM/2 + 1; 384 x += sizeM/2 + 1;
389 x += sizeM + 1; 385 x += sizeM + 1;
390 } 386 }
391 387
392 if ( mIncidence->typeID() == todoID ){ 388 if ( mIncidence->typeID() == todoID ){
393 Todo* td = ( Todo* ) mIncidence; 389 Todo* td = ( Todo* ) mIncidence;
394 if ( td->isCompleted() ) { 390 if ( td->isCompleted() ) {
395 int half = size/2; 391 int half = size/2;
396 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; 392 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
397 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; 393 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
398 x += half+half + 4; 394 x += half+half + 4;
399 395
400 } else { 396 } else {
401 int val = td->percentComplete()/20; 397 int val = td->percentComplete()/20;
402 p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); 398 p->fillRect ( x+1, y-2, val ,size+4,Qt::black );
403 p->drawRect ( x, y-2,7,size+4); 399 p->drawRect ( x, y-2,7,size+4);
404 x += size + 3; 400 x += size + 3;