summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 5a3c4d2..c7bc6eb 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -100,54 +100,54 @@ QString KOAgendaItem::getWhatsThisText()
void KOAgendaItem::init ( Incidence *incidence, QDate qd )
{
mIncidence = incidence;
mDate = qd;
mFirstMultiItem = 0;
mNextMultiItem = 0;
mLastMultiItem = 0;
computeText();
if ( (incidence->typeID() == todoID ) &&
( !((static_cast<Todo*>(incidence))->isCompleted()) &&
((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
else
mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
}
else {
QStringList categories = mIncidence->categories();
QString cat = categories.first();
if (cat.isEmpty()) {
if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) )
mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
else
- mBackgroundColor =KOPrefs::instance()->mEventColor;
+ mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() );
} else {
mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
- mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
+ mBackgroundColor = KOPrefs::instance()->mTodoDoneColor;
}
}
}
mColorGroup = QColorGroup( mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
setBackgroundColor( mBackgroundColor );
mConflictItems.clear();
setCellXY(0,0,1);
setCellXWidth(0);
setSubCell(0);
setSubCells(1);
setMultiItem(0,0,0);
startMove();
mSelected = true;
select(false);
QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
mFontPixelSize = fontinf.height();;
hide();
xPaintCoord = -1;
yPaintCoord = -1;
}
@@ -180,49 +180,49 @@ void KOAgendaItem::recreateIncidence()
mIncidence = mIncidence->recreateCloneException( mDate );
}
bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
{
int size = AGENDA_ICON_SIZE;
int yOff = 0;
int xOff = 0;
int x = pos().x() +3;
int y;
if ( mAllDay )
y = pos().y()+3;
else
y = mCellYTop * ( height() / cellHeight() ) +3;
if (mIncidence->cancelled()) {
int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
if ( horLayout )
++xOff;
else
++yOff;
}
- if (mIncidence->isAlarmEnabled()) {
+ if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->recurrence()->doesRecur()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->description().length() > 0) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isReadOnly()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white );
if ( horLayout )
++xOff;