summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp28
-rw-r--r--korganizer/kodaymatrix.h4
2 files changed, 23 insertions, 9 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
bDays.resize ( NUMDAYS );
+ hDays.resize ( NUMDAYS );;
+ eDays.resize ( NUMDAYS );;
days = new QDate[NUMDAYS];
daylbls = new QString[NUMDAYS];
- events = new int[NUMDAYS];
+ //events = new int[NUMDAYS];
mToolTip = new DynamicTip(this);
@@ -242,3 +244,3 @@ KODayMatrix::~KODayMatrix()
delete [] daylbls;
- delete [] events;
+ //delete [] events;
delete mToolTip;
@@ -313,3 +315,3 @@ void KODayMatrix::recalculateToday()
for (int i=0; i<NUMDAYS; i++) {
- events[i] = 0;
+ //events[i] = 0;
days[i] = startdate.addDays(i);
@@ -351,2 +353,4 @@ void KODayMatrix::updateViewTimed()
bDays.clearBit(i);
+ hDays.clearBit(i);
+ eDays.clearBit(i);
for(event=eventlist.first();event != 0;event=eventlist.next()) {
@@ -358,2 +362,3 @@ void KODayMatrix::updateViewTimed()
if ( event->isHoliday()) {
+ hDays.setBit(i);
if ( !holiStr.isEmpty() )
@@ -373,3 +378,4 @@ void KODayMatrix::updateViewTimed()
}
- events[i] = numEvents;
+ if ( numEvents )
+ eDays.setBit(i);
//if it is a holy day then draw it red. Sundays are consider holidays, too
@@ -450,3 +456,6 @@ void KODayMatrix::updateEvents()
}
- events[ i ] = numEvents;
+ if ( numEvents )
+ eDays.setBit(i);
+ else
+ eDays.clearBit(i);
}
@@ -864,3 +873,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
// if any events are on that day then draw it using a bold font
- if (events[i] > 0) {
+ if ( eDays.testBit(i) ) {
QFont myFont = font();
@@ -873,3 +882,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if ( bDays.testBit(i) ) {
- p.setPen(Qt::green);
+ if ( hDays.testBit(i) )
+ p.setPen(QColor(Qt::green));
+ else
+ p.setPen(QColor(Qt::green).dark());
} else {
@@ -911,3 +923,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
// reset bold font to plain font
- if (events[i] > 0) {
+ if ( eDays.testBit(i)) {
QFont myFont = font();
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 2a1959c..38a7f92 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -232,2 +232,4 @@ private:
QBitArray bDays;
+ QBitArray hDays;
+ QBitArray eDays;
QPixmap myPix;
@@ -272,3 +274,3 @@ private:
*/
- int *events;
+ //int *events;