summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-20 12:49:50 (UTC)
committer alwin <alwin>2005-03-20 12:49:50 (UTC)
commita93e2c40f08388b7dea93a3dd0ce69b029a59092 (patch) (side-by-side diff)
treeaf9e8cf769ae003db22b2a84d8b3fc3aeac90183
parente006544cf2eb82b503b3ef979a2159b5de93037e (diff)
downloadopie-a93e2c40f08388b7dea93a3dd0ce69b029a59092.zip
opie-a93e2c40f08388b7dea93a3dd0ce69b029a59092.tar.gz
opie-a93e2c40f08388b7dea93a3dd0ce69b029a59092.tar.bz2
last stuff before 1.2:
when day has a holiday-fake-event and not other allday-event it will paint green.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookmonth.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 421559e..013ab66 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -538,39 +538,44 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg,
if ( selected )
p->setPen( g.highlightedText() );
else
p->setPen( g.text() );
QValueStack<int> normalLine;
QValueStack<int> repeatLine;
QValueStack<int> travelLine;
bool normalAllDay = FALSE;
bool repeatAllDay = FALSE;
bool travelAllDay = FALSE;
+ bool holidayAllDay = FALSE;
QValueListIterator<EffectiveEvent> itDays = d->mDayEvents.begin();
for ( ; itDays != d->mDayEvents.end(); ++itDays ) {
int w = cr.width();
Event ev = (*itDays).event();
int f = (*itDays).start().hour(); // assume Effective event
int t = (*itDays).end().hour(); // is truncated.
if (ev.isAllDay()) {
- if (!ev.hasRepeat())
- normalAllDay = TRUE;
- else
- repeatAllDay = TRUE;
+ if (!ev.hasRepeat()) {
+ normalAllDay = TRUE;
+ if (!ev.isValidUid()) {
+ holidayAllDay = TRUE;
+ }
+ } else {
+ repeatAllDay = TRUE;
+ }
} else {
int sLine, eLine;
if (f == 0)
sLine = 0;
else if (f < 8 )
sLine = 1;
else if (f >= 17)
sLine = w - 4;
else {
sLine = (f - 8) * (w - 8);
if (sLine)
sLine /= 8;
@@ -590,39 +595,45 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg,
}
if (!ev.hasRepeat()) {
normalLine.push(sLine);
normalLine.push(eLine);
} else {
repeatLine.push(sLine);
repeatLine.push(eLine);
}
}
}
// draw the background
- if (normalAllDay || repeatAllDay || travelAllDay) {
+ if (normalAllDay || repeatAllDay || travelAllDay || holidayAllDay) {
p->save();
if (normalAllDay)
if (repeatAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height() / 2,
colorNormalLight );
p->fillRect( 0, cr.height() / 2, cr.width(), cr.height() / 2,
colorRepeatLight );
- } else
+ } else {
+ if (!holidayAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height(),
colorNormalLight );
- else if (repeatAllDay)
+ } else {
+ p->fillRect( 0, 0, cr.width(), cr.height(),
+ QColor(0,220,0) );
+ }
+ } else if (repeatAllDay) {
p->fillRect( 0, 0, cr.width(), cr.height(),
colorRepeatLight );
+ }
} else {
p->fillRect( 0, 0, cr.width(),
cr.height(), selected
? g.brush( QColorGroup::Highlight )
: g.brush( QColorGroup::Base ) );
}
// The lines
// now for the lines.
int h = 5;
int y = cr.height() / 2 - h;