-rw-r--r-- | korganizer/koagendaitem.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index a42d07b..c055eb8 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -119,25 +119,25 @@ void KOAgendaItem::initColor () } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; } } } QColor BackgroundColor ( mBackgroundColor ); if ( mIncidence->calID() > 1 ) { - BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); + //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); } mColorGroup = QColorGroup( BackgroundColor.light(), BackgroundColor.dark(),BackgroundColor.light(), BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); } void KOAgendaItem::init ( Incidence *incidence, QDate qd ) { mIncidence = incidence; mDate = qd; mFirstMultiItem = 0; @@ -191,24 +191,38 @@ void KOAgendaItem::recreateIncidence() 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->calID() > 1 ) { + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); + p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 ); + if ( horLayout ){ + ++xOff; + ++x; + } + else { + ++yOff; + ++y; + } + } 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() && mIncidence->alarmEnabled()) { p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); |