-rw-r--r-- | library/datebookmonth.cpp | 25 |
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 @@ -546,8 +546,9 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg, bool normalAllDay = FALSE; bool repeatAllDay = FALSE; bool travelAllDay = FALSE; + bool holidayAllDay = FALSE; QValueListIterator<EffectiveEvent> itDays = d->mDayEvents.begin(); for ( ; itDays != d->mDayEvents.end(); ++itDays ) { @@ -557,12 +558,16 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg, 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; @@ -598,23 +603,29 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg, } } // 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 ) |