summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 59618bf..d543aaf 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -117,5 +117,7 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
117 bDays.resize ( NUMDAYS ); 117 bDays.resize ( NUMDAYS );
118 hDays.resize ( NUMDAYS );;
119 eDays.resize ( NUMDAYS );;
118 days = new QDate[NUMDAYS]; 120 days = new QDate[NUMDAYS];
119 daylbls = new QString[NUMDAYS]; 121 daylbls = new QString[NUMDAYS];
120 events = new int[NUMDAYS]; 122 //events = new int[NUMDAYS];
121 mToolTip = new DynamicTip(this); 123 mToolTip = new DynamicTip(this);
@@ -242,3 +244,3 @@ KODayMatrix::~KODayMatrix()
242 delete [] daylbls; 244 delete [] daylbls;
243 delete [] events; 245 //delete [] events;
244 delete mToolTip; 246 delete mToolTip;
@@ -313,3 +315,3 @@ void KODayMatrix::recalculateToday()
313 for (int i=0; i<NUMDAYS; i++) { 315 for (int i=0; i<NUMDAYS; i++) {
314 events[i] = 0; 316 //events[i] = 0;
315 days[i] = startdate.addDays(i); 317 days[i] = startdate.addDays(i);
@@ -351,2 +353,4 @@ void KODayMatrix::updateViewTimed()
351 bDays.clearBit(i); 353 bDays.clearBit(i);
354 hDays.clearBit(i);
355 eDays.clearBit(i);
352 for(event=eventlist.first();event != 0;event=eventlist.next()) { 356 for(event=eventlist.first();event != 0;event=eventlist.next()) {
@@ -358,2 +362,3 @@ void KODayMatrix::updateViewTimed()
358 if ( event->isHoliday()) { 362 if ( event->isHoliday()) {
363 hDays.setBit(i);
359 if ( !holiStr.isEmpty() ) 364 if ( !holiStr.isEmpty() )
@@ -373,3 +378,4 @@ void KODayMatrix::updateViewTimed()
373 } 378 }
374 events[i] = numEvents; 379 if ( numEvents )
380 eDays.setBit(i);
375 //if it is a holy day then draw it red. Sundays are consider holidays, too 381 //if it is a holy day then draw it red. Sundays are consider holidays, too
@@ -449,4 +455,7 @@ void KODayMatrix::updateEvents()
449 } 455 }
450 } 456 }
451 events[ i ] = numEvents; 457 if ( numEvents )
458 eDays.setBit(i);
459 else
460 eDays.clearBit(i);
452 } 461 }
@@ -864,3 +873,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
864 // if any events are on that day then draw it using a bold font 873 // if any events are on that day then draw it using a bold font
865 if (events[i] > 0) { 874 if ( eDays.testBit(i) ) {
866 QFont myFont = font(); 875 QFont myFont = font();
@@ -871,7 +880,10 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
871 // if it is a holiday then use the default holiday color 880 // if it is a holiday then use the default holiday color
872 if (!mHolidays[i].isNull()) { 881 if ( !mHolidays[i].isNull()) {
873 if ( bDays.testBit(i) ) { 882 if ( bDays.testBit(i) ) {
874 p.setPen(Qt::green); 883 if ( hDays.testBit(i) )
884 p.setPen(QColor(Qt::green));
885 else
886 p.setPen(QColor(Qt::green).dark());
875 } else { 887 } else {
876 if (actcol == mDefaultTextColor) { 888 if (actcol == mDefaultTextColor ) {
877 p.setPen(KOPrefs::instance()->mHolidayColor); 889 p.setPen(KOPrefs::instance()->mHolidayColor);
@@ -911,3 +923,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
911 // reset bold font to plain font 923 // reset bold font to plain font
912 if (events[i] > 0) { 924 if ( eDays.testBit(i)) {
913 QFont myFont = font(); 925 QFont myFont = font();