summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp5
-rw-r--r--korganizer/koagendaitem.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 1be0aca..e660c32 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -134,9 +134,9 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
134 mColorGroup = QColorGroup( mBackgroundColor.light(), 134 mColorGroup = QColorGroup( mBackgroundColor.light(),
135 mBackgroundColor.dark(),mBackgroundColor.light(), 135 mBackgroundColor.dark(),mBackgroundColor.light(),
136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; 136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
137 setBackgroundColor( mBackgroundColor ); 137 setBackgroundColor( mBackgroundColor );
138 138 mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250);
139 mConflictItems.clear(); 139 mConflictItems.clear();
140 setCellXY(0,0,1); 140 setCellXY(0,0,1);
141 setCellXWidth(0); 141 setCellXWidth(0);
142 setSubCell(0); 142 setSubCell(0);
@@ -404,10 +404,9 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
404 yy+= AGENDA_ICON_SIZE+2; 404 yy+= AGENDA_ICON_SIZE+2;
405 h -=(AGENDA_ICON_SIZE+3); 405 h -=(AGENDA_ICON_SIZE+3);
406 } 406 }
407 } 407 }
408 int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); 408 if ( mWhiteText )
409 if ( colsum < 250 )
410 paint->setPen ( white); 409 paint->setPen ( white);
411 if ( x < 0 ) { 410 if ( x < 0 ) {
412 w = w+x-3; 411 w = w+x-3;
413 x = 3; 412 x = 3;
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 53658c0..d1b1940 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -121,8 +121,9 @@ class KOAgendaItem : public QWidget
121 121
122 private: 122 private:
123 KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; 123 KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis;
124 bool mAllDay; 124 bool mAllDay;
125 bool mWhiteText;
125 int mCellX; 126 int mCellX;
126 int mCellXWidth; 127 int mCellXWidth;
127 int mCellYTop,mCellYBottom; 128 int mCellYTop,mCellYBottom;
128 int mSubCell; // subcell number of this item 129 int mSubCell; // subcell number of this item